4

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.

2 Answers 2

5
+50

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 terminal

sudo apt-get install autokey-gtk

After 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

Run autokey-gtk

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:

1. keyboard.send_keys("<ctrl>+c")

2. keyboard.send_keys("<ctrl>+v")

3. keyboard.send_keys("<ctrl>+x")

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 and click on the Control button and then click OK.

**Do this for each script, being sure to modify your hotkey of course.*

Step 6

Click on *Edit* -> *Preferences*

Select the check box next to Automatically start Autokey at Login

This should accomplish what your asking for :)

0
1
"xdotool key --delay 0 --clearmodifiers ctrl+c"
    Control + q + Release

Source: http://www.ict.griffith.edu.au/anthony/info/X/event_handling.txt (search for 'Generating X Keyboard Events')

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .