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

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.


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)

:)