rvaiya / warpd

A modal keyboard-driven virtual pointer
MIT License
2.94k stars 133 forks source link

Support for Dvorak / alternative keyboard layouts #189

Closed andrewjunyoung closed 2 years ago

andrewjunyoung commented 2 years ago

Hey! I love this project, but I use Dvorak to type.

Let's say I want to go to fj. In order to jump to a certain location on the screen, I have to press the hardware key that corresponds to where f and j are on the QWERTY keyboard; not where they are located on my keyboard layout (Dvorak).

Is there an existing way that I can use a Dvorak keyboard with Warpd? If not, I am more than happy to make the changes myself, but I don't know where to make changes to enable this.

Is there current support for alternative software-level keyboard layouts (in particular Dvorak)?

rvaiya commented 2 years ago

This should be fixed in the latest commit. I assume you are running an older version.

andrewjunyoung commented 2 years ago

Hi -- this issue isn't resolved. I've tried with the Mac pre-installed Dvorak version, and with a custom .keylayout file that I compiled myself. Both ultimately use the QWERTY key layout to move the mouse.

Here's my version info:

> warpd --version
warpd v1.3.4-osx (built from: daf11b2)

And here are all the keyboard layouts that I tested. All of these keyboard will default to the QWERTY built-in keyboard.

                {
            InputSourceKind = "Keyboard Layout";
            "KeyboardLayout ID" = "-25082";
            "KeyboardLayout Name" = "JDvorak keyboard (iso)";
        },
                {
            InputSourceKind = "Keyboard Layout";
            "KeyboardLayout ID" = 16300;
            "KeyboardLayout Name" = Dvorak;
        },
                {
            "Bundle ID" = "com.google.inputmethod.Japanese";
            "Input Mode" = "com.apple.inputmethod.Japanese";
            InputSourceKind = "Input Mode";
        },
                {
            InputSourceKind = "Keyboard Layout";
            "KeyboardLayout ID" = "-1";
            "KeyboardLayout Name" = "Unicode Hex Input";
        },
                {
            "Bundle ID" = "com.apple.inputmethod.SCIM";
            "Input Mode" = "com.apple.inputmethod.SCIM.Shuangpin";
            InputSourceKind = "Input Mode";

        }

What's the current method that's detects what keyboard layout a user is using?

andrewjunyoung commented 2 years ago

I found the fix!

Uninstalling and re-granting Accessibility permissions inside System Preferences worked, and now warpd works with all the above-listed keyboards.

But... there's still a bug.

It seems that warpd only checks the keylayout once. If I load warpd with a Dvorak keyboard then switch to a QWERTY keyboard, warpd will not update my keyboard "layout" to use QWERTY. The same is true if I start running warpd when my keyboard is in QWERTY, and later switch to Dvorak.