7

I am a Dvorak layout user and I am happy with the switch.

I avoided the undo/cut/copy/paste shortcut disadvantage (the z,c,x and v are far apart on Dvorak layout) on Windows by using Microsoft's Keyboard layout creator to map control key combinations back to their QWERTY counterparts, but it's bugging me that I can't do the same on Ubuntu/Linux, even though it has a more advanced input framework.

dvorak-querty is supposed to accomplish this but doesn't work for me.

The comments on the bugs referred to by a previous similar question doesn't provide any viable workaround for this.

So is there anything I can do aside waiting (for years) for the bugs to be fixed, like writing a custom keyboard layout or ibus plugin?

Clarification (another way of putting my question)

Is there any way to use QWERTY's keyboard shortcut position while the Dvorak layout is active?

For example, to 'Copy', I have to press Ctrl+i (the position of the 'I' on QWERTY is 'C' on Dvorak, which is a awkward stretch), then for 'Paste', I have to press Ctrl+. (another awkward position). I want to press Ctrl+c and Ctrl+v.

Currently I'm using the old-style shortcuts I learned from the DOS-era, Shift-Del for cut and Ctrl+Insert for copy...

3
  • Quoted from Wikipedia: Operating systems based on UNIX, including OpenBSD, FreeBSD, NetBSD, Open Solaris, and most Linux distributions, can be configured to use the U.S. Dvorak layout and a handful of variants. However, all current Unix-like systems with X.Org and appropriate key-maps installed (and virtually all desktop systems include them) are able to use any QWERTY-labeled keyboard as a Dvorak one without any problems or additional configuration. This removes the burden of producing additional key-maps for every variant of QWERTY provided. Run-time layout switching is also possible.
    – Mitch
    May 29, 2012 at 9:00
  • 1
    I know how to switch to Dvorak and use it on an ordinary keyboard. My question is is there any way to use QWERTY's keyboard shortcut position while the Dvorak layout is active? For example, to 'Copy', I have to press Ctrl+I (the position of the 'I' on QWERTY is 'C' on Dvorak, which is a awkward stretch), then for 'Paste', I have to press Ctrl+. (another awkward position). I want to press Ctrl+C and Ctrl+V Currently I'm using the old-style shortcuts I learned from the DOS-era, Shift-Del for cut and Ctrl+Insert for copy...
    – Thanh Phú
    May 29, 2012 at 13:04
  • Try linux mint or the following github.com/tbocek/dvorak
    – William
    Apr 3, 2022 at 1:21

4 Answers 4

3

My first attempt was to make the control keys act simultaneously as Control and as a third-level chooser, then define a keyboard layout with Dvorak on levels 1 and 2, and Qwerty on levels 3 and 4. This doesn't seem possible in XKB, however. In addition, the comments in the source of the dvorak-qwerty program you've linked state that

Although it is possible to define an XKB layout which implements Dvorak-Qwerty, doing so exposes a depressing number of bugs across the board in X apps. Since it is the responsibility of each X app to interpret the keyboard layout itself, rather than having the X server do the work, different GUI frameworks actually tend to have different bugs that kick in when using such a layout. Fixing them all would be infeasible.

Your best bet is probably to get the dvorak-qwerty hack working. Most of what I'm about to write you probably know. The source says to compile it with

gcc xdq.c -o xdq -std=c99 -O2 -lX11

then run it with

./xdq

or give the absolute path so you can put it in your startup items.

When I ran the program it gave me the following warning:

Failed to grab 35 key combinations. This is probably because some hotkeys are already grabbed by the system. Unfortunately, these system-wide hotkeys cannot be automatically remapped by this tool. However, you can usually configure them manually.

However, I tested it with ^W, ^Q, ^C, ^X, and ^V, and it worked as expected. If you want it to grab other modifiers (ALt+Ctrl and Super) the combinations the system is already using for other things, add -DXQD_GREEDY (not -DXDQ_GREEDY as the source says) to the compilation command.

If it failed to compile with the error

xdq.c:87:22: fatal error: X11/Xlib.h: No such file or directory compilation terminated.

then you should install the package libx11-dev with

sudo apt-get install libx11-dev

If this doesn't get the program working, let me know and we can try to work it out.

5
  • I am trying this on the latest Ubuntu, 12.04. The compilation went smoothly, but it just doesn't work. 1. I set my keyboard layout to Dvorak 2. Compile and run thanhphu@ubuntu:~/Downloads$ gcc xdq.c -o xdq -std=c99 -O2 -lX11 -DXDQ_GREEDY thanhphu@ubuntu:~/Downloads$ ./xdq 3. And then that's it. There's no warning whatsoever, but I can't use QWERTY shortcut to copy. Even the program itself has to be stopped using Ctrl+"I"
    – Thanh Phú
    Jun 1, 2012 at 4:42
  • First, -DXDQ_GREEDY shouldn't do anything, because of a typo in the source, and the actual flag, -DXQD_GREEDY, doesn't do what I thought - see my edits above.
    – pconley
    Jun 1, 2012 at 8:12
  • 1
    Second, could you please open the source in your favourite editor (I'm assuming you don't know any C - feel free to correct me on this), find the line int main(int argc, char* argv[]) { and add fprintf(stderr, "Starting\n"); just below it; then find for(;;) { and add fprintf(stderr, "Event loop\n"); below that. Then recompile, run, try some copy-paste, and tell me what gets printed.
    – pconley
    Jun 1, 2012 at 8:18
  • Are you running this from Gnome Terminal (or equivalent) or are you running it from a console - Ctrl-Alt-F1 through Ctrl-Alt-F6? It shouldn't work in the latter case.
    – pconley
    Jun 1, 2012 at 8:20
  • I know my bit of C, but let's just presume that I'm stupid in this case :p. Yes, I tried it in the Gnome terminal and not a console. I changed the debug directive and the result is Failed to grab 2 key combinations. This is probably because some hotkeys are already grabbed by the system. Unfortunately, these system-wide hotkeys cannot be automatically remapped by this tool. However, you can usually configure them manually. Event loop - the Event loop is entered only once, I have also added a similar printf to the "if (event.xkey.keycode >= 0..." and it was never hit as I press control keys
    – Thanh Phú
    Jun 4, 2012 at 1:03
2

tl;dr

You need to turn NumLock off.

Explanation

dvorak-querty works by "grabbing" (more like "stealing") keyboard combinations from other programs. Combinations that include certain modifiers (Control, Control+Shift, Alt and Alt+Shift) are stolen, "qwerty'd" and returned to the original program.

The problem is that those, and only those, are the only modifier combinations that are stolen. Other modifiers, such as CapsLock and NumLock, are not stolen.

So if you have NumLock active and hit Ctrl+C, dvorak-qwery will "perceive" NumLock+Ctrl+C and therefore not steal it.

So turn off any additional implicit modifiers that you see on your keyboard.

Alternate solution

If you want to run dvorak-qwerty and enable NumLock at the same time, you might want to try my version of the code (check out Arguments)

:)

1

Many years later, I am still using AutoKey on X11, with individual key mappings. Sad.

0

For those who are looking at this question 7 years later and beyond, here's what worked for me (no coding needed!):

  • Download https://github.com/ZeptByteS/dvorak-qwerty/tree/develop as a zip file
  • Unzip
  • Run sudo ./install.sh
  • (Ubuntu) Go to Settings / Region & Language / Input Sources
  • Press the plus button
  • Choose English (United States)
  • Choose any of the English (Dvorak-Qwerty) layout, the flavor you prefer
  • Now switch the keyboard layout to your newly added layout

Pictures and how to apply Dvorak Qwerty for other major OSes are available here

You must log in to answer this question.

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