How can the Ctrl+Q key combination be mapped to the Ctrl+C event?
My keyboard is mapped to programmer-dvorak and I would like to have the Ctrl+X , Ctrl+C and Ctrl+V events to be mapped to Ctrl+' , Ctrl+Q , Ctrl+J key presses respectively.
Mac OSX has something called Dvorak - Qwerty that does this.
You may also want to try Dvorak - Qwerty which uses Dvorak for typing but Qwerty for keyboard shortcuts like ⌘ (command) A. This can be handy if you've memorized common command combinations like ⌘X,C,V (for cut, copy, paste), etc by location on your keyboard,
So far, I've tried a combination of xbindkeys with xdotool without any luck.
#Dvorak Cut
"xdotool key --delay 0 --clearmodifiers ctrl+x"
m:0x4 + c:52
Control + apostrophe
#Dvorak Copy
"xdotool key --delay 0 --clearmodifiers ctrl+c"
m:0x4 + c:53
Control + q
#Dvorak Paste
"xdotool key --delay 0 --clearmodifiers ctrl+v"
m:0x4 + c:54
Control + j
I've also tried via XKB with the following entries.
// Ctrl+' for Cut
interpret apostrophe + Ctrl {action = Redirect(Key=<AB05>, modifiers=Control);};
// Ctrl+q for Copy
interpret q + Ctrl {action = Redirect(Key=<AD08>, modifiers=Control);};
// Ctrl+j for Paste
interpret j + Ctrl {action = Redirect(Key=<AB09>, modifiers=Control);};
But that doesn't work either.
You can use
autokey-gtk
. If you set Autokey to run at login, it will sit in the background and monitor input from your keyboard and mouse.Example: You stated you would like to make Ctrl + Q act like Ctrl + C. If you ask
autokey-gtk
to "press" Ctrl + C when Ctrl + Q is pressed.To install
autokey-gtk
issue the following command in a terminalAfter installation, you can access it through the Dash or by typing
auto-gtk
in a terminal. To set the key combinations that you stated above, do the following:Step 1
Step 2
Create a New Top-Level Folder from File -> Create -> New Top-Level Folder
Step 3
Select Folder and create New Script from File -> Create -> New Script
Step 4
in the # Enter script code box, enter
"keyboard.send_keys(shortcut you desire to imitate)"
Examples:
NOTE: repeat Step 3-4 for each hotkey you want to add
Step 5
For each Script you made click on the second "set button" next to Hotkey and enter your key combination that you will use to imitate.
In your case for the
keyboard.send_keys("<ctrl>+c") script
you would type Q in the text box andclick on the Control button
and then click OK.**Do this for each script, being sure to modify your hotkey of course.*
Step 6
Select the check box next to
Automatically start Autokey at Login
This should accomplish what your asking for :)
Source: http://www.ict.griffith.edu.au/anthony/info/X/event_handling.txt (search for 'Generating X Keyboard Events')