Xbindkeys / ubuntu assign copy paste to mouse buttons - mouse

in Ubuntu 20.04 LTS i try to customize my logitech mx master 3 mouse buttons with xbindkeys
I edit the settings in
~/.xbindkeysrc
something like this works fine for bottons 8 and 9 :
# Mouse Button #8
"nautilus"
b:8
# Mouse Button #9
"firefox"
b:9
but i need to assign copy command to button 8 and paste command to button 9, instead of opening applications.
Does somebody have an idea about how to do tell "copy" or "paste" to xbindkeys ?

use for my logitech m500:
#CTRL + C
"xte 'keydown Control_L' 'key c' 'keyup Control_L'"
b:8
#CTRL + V
"xte 'keydown Control_L' 'key v' 'keyup Control_L'"
b:9

Related

Multiline editing in Visual Studio Code

Is it possible to enable multiline editing like in Sublime Text?
For example, press Ctrl to place additional cursor carets and being able to write/delete on multiple places in the document at one time.
On Windows, you hold Ctrl+Alt while pressing the up ↑ or down ↓ arrow keys to add cursors.
Mac: ⌥ Opt+⌘ Cmd+↑/↓
Linux: Shift+Alt+↑/↓
Note that third-party software may interfere with these shortcuts, preventing them from working as intended (particularly Intel's HD Graphics software on Windows; see comments for more details).
If you experience this issue, you can either disable the Intel/other software hotkeys, or modify the VS Code shortcuts (described below).
Press Esc to reset to a single cursor.
Or, as Isidor Nikolic points out, you can hold Alt and left click to place cursors arbitrarily.
You can view and edit keyboard shortcuts via:
File → Preferences → Keyboard Shortcuts
Documentation:
https://code.visualstudio.com/docs/customization/keybindings
Official VS Code Keyboard shortcut cheat sheets:
https://code.visualstudio.com/shortcuts/keyboard-shortcuts-windows.pdf
https://code.visualstudio.com/shortcuts/keyboard-shortcuts-macos.pdf
https://code.visualstudio.com/shortcuts/keyboard-shortcuts-linux.pdf
Solved using just two steps!
Ctrl + F
Alt + Enter
It's equal to Sublime Text's Alt + F3.
Note: For macOS, ⌘ + F followed by ⌥ + Enter is equivalent to Sublime Text's ⌃ + ⌘ + G.
You can just Alt + click for additional cursors. And as already mentioned, Ctrl + Alt + ↑ or ↓.
Box Selecting
Windows: shift + alt + Mouse Left Button
macOS: shift + option + Click
This is contrary to what is mentioned in an answer to Does Visual Studio Code have box select/multi-line edit?.
I wanted to select multiple lines and hit "something" to have a cursor for each select lines (similar to Ctrl + Shift + L in Sublime Text). This action in Visual Studio Code is called "Add Cursors to Line Ends".
This was tested in Visual Studio Code 1.51.1 and works on both Windows and Mac.
Here is the way:
Select the lines you want to have multiple cursors.
Simply hit Alt + Shift-I.
You now have one cursor per selected line.
Use Ctrl + D to use multi word edit of same words in Windows and Linux.
Use CMD + D for Mac.
In the latest release of Visual Studio Code, you can now drag the cursor while holding Option (Alt on Windows) to select the same column on multiple rows.
To enable this, make sure you change your editor.multiCursorModifier to look like this:
"editor.multiCursorModifier": "ctrlCmd"
From the Visual Studio Code release notes 1.32.0:
In the following video, the selection begins as a regular selection and then Alt is pressed and held until the mouse button is released:
From the version 1.13 (May 2017) you can finally change the default modifier key for creating multiple cursors (add to settings):
"editor.multiCursorModifier": "ctrlCmd"
P.S.: The modifier "follow link" from this moment will be Alt.
Step 1:
Select the word to be replaced.
Step 2:
Use Ctrl + F to select its multiple occurrences.
Step 3:
Use Alt + Enter to set cursor at all the found occurrences.
Step 4:
Just start typing the new word.
Alternatively on Mac:
⌥ Opt + Click to set cursor on the click location.
On Mac it is:
Option + Command while pressing the up ↑ or down ↓ arrow keys.
I am using the vscodevim extension, so I'm not sure if this is a common problem. But, I was having the issue where Ctrl + Alt + UpArrow flipped my screen upside down.
Looking at the Visual Studio Code Basics (I don't know if they changed this in a recent update), it says to use:
Ctrl + Alt + Shift + (Up/down)
Working solution for me was first selecting the required text to edit and then using CTRL + F2 to select all matching data in the page.
You may also use CTRL+Shift+L as suggested by #lesterCovax
Please Note: The above solution uses the inherent ability of VSCode editor to select similar text across the entire page, and therefore, be careful.
For me the above solution of Ctrl + ALT + Arrowkeys did not work as it caused the screen to change its display orientation against selecting the lines in VSCode.
(Windows 10 pro x64) Here have some ways!
Alt + click
Alt + Ctrl + up/down
Keybindings: Ctrl + click (??? it doesn't work!)
To add multiple cursors at any text position
This is done by using Ctrl+Click. Firstly you have to enable Multiple-Cursor Modifier. Simply type this option on Command Palette by Ctrl+Shift+P to enable it.
To remove a cursor form multiple text position.
Do Ctrl+Click on the cursor.
As of April 2018 (version 1.23) you can now also use the middle mouse button to multiline select / box select.
version 1.43 (February 2020)
You can now toggle column selection mode, which changes mouse gestures and arrow keys, via:
Menu Bar > Selection > Column Selection Mode
Ctrl+Shift+P (Show All Commands) > Toggle Column Selection Mode
Bind your key for command "editor.action.toggleColumnSelection"
Note: There is a "Column Selection" panel in the status bar after activation, which you can press to disable it again.
According to VS Code 1.55.2 version(2021) under User > Commonly Used section there is an option as Multi Cursor Modifier. See below image.
for multi cursor default key is alt if you want it can change to Ctrl.
Moreover, for suitable places, you can hold the Middle Mouse button and move to down.
In Windows, the below combinations work for me:
Ctrl + Shift + Alt + down arrow
Ctrl + Shift + Alt + up arrow
In addition to all of the answers, there is one more way. Select the lines you want and then press:
Windows: Shift + Alt + i
Mac: shift + option + i
This puts a cursor in every row in the selection.
In Visual Studio Code just press Alt and place your cursor to the edit place(where you want to edit) and right click to select.
(NO MOUSE) For macOS, I found this to be very quick!
CMD + f To search the (word) you want to change.
Option + Enter To select all word you search for.
Just update the first word and it will update all the selected.
I think it depends on your Visual Studio Code version.
Mine is Linux version Visual Studio Code 1.7.2.
{ "key": "ctrl+shift+up", "command": "editor.action.insertCursorAbove",
"when": "editorTextFocus" },
{ "key": "shift+alt+up", "command": "editor.action.insertCursorAbove",
"when": "editorTextFocus" },
{ "key": "ctrl+shift+down", "command": "editor.action.insertCursorBelow",
"when": "editorTextFocus" },
{ "key": "shift+alt+down", "command": "editor.action.insertCursorBelow",
"when": "editorTextFocus" }
The point is the shortcuts are not same in all machines, so you should check your configuration. Go to menu:
Menu File → Preferences → Keyboard Shortcuts
Search for editor.action.insertCursorAbove and editor.action.insertCursorBelow and see your current configurations. You may change them if they conflict with operating system's shortcut keys.
If you're using Linux, there's a possibility of a conflict with Alt + click, which is the default for "moving a window".
You can go to menu Settings → Window Behavior → Window Behavior → Actions tab
Just remove Alt + left (hold) and it will work.
This is the best way, because you don't need to hold two + keys to do such a simple task.
I am using the latest version of VS code i.e., 1.46.1 (May 2020) in Windows 10. Just press Alt+mouse left click on the lines you want to select. This will let you select multiple lines at once and let you edit them. Also Press Esc to exit from it.
This is really helpful if you're coming from sublime text.
Just Opt + click works for me on Mac
My settings: Windows 8.1 64 bits, Visual Studio Code version 1.33.1.
Problem: Conflict with keyboard shortcuts of Intel HD Graphics 4000
I had a problem when I was using the default shortcuts of the Visual Studio Code (Ctrl + Alt + UP, Ctrl + Alt + DOWN). In my case, these commands were turning my screen in 0º and 180º respectively. It's happening, because there is the Graphic Intel application installed on my computer. Then, I just disable the shortcuts of this application.
Here is an tutorial to help someone.
I am using the Sublime Text keymap and the keybinding provided by the top answer did not seem to work :( Could be some conflicts between Visual Studio Code and sublime keymaps.
The keybinding recommended by #Han works for me (much appreciated!):
Enter multiline cursor mode with Ctrl + Shift + Up/Down
Exit with Esc
(Sidenote) Below is a small example of using Emmet together with the multiline cursor (enabled and disabled with these key bindings listed above):
On windows, you can create additional cursor on the next/previous lines by pressing:
Ctrl + Alt + Shift +Down/Up
Missing the Shift will flip your screen.
Creating additional cursors will allow you to edit multiple lines at once.
Well, I used the Alt key to select the lines where I wanted to edit, and that's it.
Alternatively, we can use the Ctrl + Alt + UP/DOWN arrow if the things to be edited are above or below.
The solution from #maxime of using SHIFT + ALT + i worked for me, when I needed to quickly edit ~20k lines in a file. Most of the other keyboard shortcuts mentioned are only useful for a limited number of line. SHIFT selecting the area you want to column edit, then pressing SHIFT + ALT + i is the most efficient way to handle this.
What I accidentally discovered though, (and hasn't been mentioned here yet) is that there is a limit of 10k lines in "cursor edit mode" (there's an open Github feature request to increase it). This means that for extremely large files, it may be better to script your edits, rather than doing it manually.
For those like #specimen that had to use shortcuts like CTRL + SHIFT + L (default binding is Select all occurrences of current selection) to accomplish this, you should check that you don't have a keymap extension installed. You can check by searching for #recommended:keymaps in the extensions pane, going to File > Preferences > Keymaps (CTRL+K CTRL+M).
The default [Windows] keymap can be found in PDF form HERE, or you can go to File > Preferences > Keyboard Shortcuts to find/modify the current bindings. There is also more in-depth key bindings documentation HERE.

Eclipse switches # and "

Once every few hours this happens - when I press Shift-2 to get a ", and # appears. When I press Shift-' it puts in a " (although this only appears after pushing another key as well). I am on an English (as opposed to American) keyboard. I must be pressing some sort of shortcut key combination, but I don't know what it is. It goes away when I restart Eclipse. I can live with this problem, but I would rather not!
Anyone know what the shortcut I'm accidentally using is, so I can avoid it/correct it in future?
Edit: Windows 7
If you have several language layouts on the computer you are probably switching on them.
What OS are you using?
If Windows 7 the shortcut is ctrl + shift
http://www.tomshardware.com/forum/10444-63-shortcut-keys-keyboard-language-changing
If you're using windows XP i think the shortcut was alt + shift
If you are using Windows, pressing Ctrl + Shift changes keyboard layouts. In your case it seems to Switch to the US layout which has the # on Shift + 2

Aptana Studio 3 - text font size minimizing with Ctrl + -

hello I have recently installed aptana studio 3 again and I am having where my text font size minimizes when I do the command (Ctrl + -). I am talking about the font under General->Appearance->Colors and Fonts->Basic->Text Font. This command works like in photoshop/illustrator where the size minimizes. However I do not want this command because I usually press it on accident. I have looked under keys and I can't find this command so I can change it. It wouldn't be so bad but the command Ctrl + + doesn't upsize the font like it normally does in other applications. Any suggestions?
Try holding down your shift key: CTRL + SHIFT + +
Aptana Studio 3 has a problem with shortcuts.
I accidentally zoomed out my code and as I'm in Portuguese Keyboard, Ctrl Shift + didn't work to back to the default zoom value.
The solution to this problem (probably many other keyboard set's are having this problem) is to change your language preferences (Win Key space OR find it in Control Panel), to English keyboard.
Then with the help of this image, I find the + is the first key to left of the backspace.
This way you could go back to 100% zoom by hitting, Ctrl Shift (first key to left of the backspace)
Very strange situation ...
Select the whole page you are writing the code.click on the right button of the mouse. click preference.In the above of the window, there are a link named "Colors and Fonts",click here.click edit.

Mouse button modifiers - Autohotkey

I want to set up my mouse buttons to perform different functions if I press and hold them, or if I press them while holding down shift/alt/ctrl.
As some trivial examples:
Shift-leftMouseButton = "back" in firefox history?
Shift-rightMouseButton = go forward in firefox,
Press-and-hold right mouse button = some other action in firefox (eg, move to opposite screen and maximize).
EDIT:
I forgot to mention I have 5 mouse buttons. (Microsoft Wireless Laser Mouse 6000)
Well, you can map those combinations to other key combinations, as below.
shift + left mouse -> alt + left
+LBUTTON::SendInput,!{LEFT}
shift + right mouse -> alt + right
+RBUTTON::SendInput,!{RIGHT}
Beyond that, you can execute a series of commands, if you wanted to also, say, activate a Firefox window first.
To do the press-and-hold, you'd have to use a timer and it is a bit more complicated. You'd also need to figure out how you want to execute "some other action." Do you have a set of keystrokes that would achieve what you say? For example, I have CTRL + ` mapped to switch screens, so I'd send that and then Windows key + up to do it.

How to go to an error using only the keyboard in Eclipse?

Let's say I have a file with 10 lines and I have a problem with the name of the package (or something) and the cursor is on the last line of the text.
How can I go directly to that line to see what the problem is and what suggestions there are to remove the problem, using a shortcut?
Question: Is there a keyboard-shortcut for this?
Or something like this:
Go to the next error and Go to the previous error.
Windows and Linux
Go to the next error: Ctrl + .
Go to the previous error: Ctrl + ,
Show quick fixes: Ctrl + 1
Mac
Go to the next error: Cmd + .
Go to the previous error: Cmd + ,
Show quick fixes: Cmd + 1
To go to problem within project just type Shift+Alt+Q then press X. It will open the "Problems" window. Now use ↑ or ↓ to select the error/warning and press Enter to go to it.
I know it isn't simple as Crtl+. but it works for a whole project.
To complete the previous answers, you can use the combobox linked to the toolbar buttons for next/previous annotation to set the annotation level.
That makes browsing through errors using ctrl+./ ctrl+ easier,
TO GO TO NEXT ERROR ONLY in eclipse with Ctrl + . command, tick off warnings as shown in screenshot