Friday, May 3, 2024
 Popular · Latest · Hot · Upcoming
5
rated 0 times [  5] [ 0]  / answers: 1 / hits: 5168  / 1 Year ago, tue, december 27, 2022, 7:12:53

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.


More From » xorg

 Answers
3

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 :)


[#40412] Wednesday, December 28, 2022, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
tionpromoti

Total Points: 14
Total Questions: 112
Total Answers: 113

Location: Tonga
Member since Tue, Nov 30, 2021
2 Years ago
;