Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Directional Keys Not Working in Windows Task View #1042

Closed
1 task done
lnnks opened this issue May 16, 2024 · 6 comments
Closed
1 task done

Directional Keys Not Working in Windows Task View #1042

lnnks opened this issue May 16, 2024 · 6 comments
Assignees
Labels
bug Something isn't working llhook Pertains to the standard version of Kanata on Windows windows Issue pertains to Windows only

Comments

@lnnks
Copy link

lnnks commented May 16, 2024

Requirements

Describe the bug

Hi,

I'm experiencing an issue with the Kanata after mapping my keyboard. The directional keys (up, down, left, right) do not work in the Windows Task View (shortcut: Win + Tab). However, the mapped directional keys function correctly in other applications and editors.

Please let me know if additional information is required or if there is a workaround for this issue.

Thank you for your help!

Relevant kanata config

kanata.kbd:

(defsrc
   grv  1    2    3    4    5    6    7    8    9    0    -    =    bspc
   tab  q    w    e    r    t    y    u    i    o    p    [    ]    \
   caps a    s    d    f    g    h    j    k    l    ;    '    ret
   lsft z    x    c    v    b    n    m    ,    .    /    rsft
   lctl lmet lalt           spc            ralt rmet rctl
)

(deflayer default
   grv  1    2    3    4    5    6    7    8    9    0    -    =    bspc
   tab  q    w    e    r    t    y    u    up    o    p    [    ]    \
   caps  a    s    d    f    g    h    left  down  rght    ;    '    ret
   lsft  z    x    c    v    b    n    m    ,    .    /    rsft
   lctl lmet lalt         spc             ralt rmet rctl
)

To Reproduce

  1. Configure Kanata with the above configuration file.
  2. Press Win + Tab to open Windows Task View.
  3. Attempt to use the mapped directional keys to navigate in Task View.

Expected behavior

The directional keys should allow navigation within the Windows Task View.

Kanata version

kanata 1.6.1

Debug logs

No response

Operating system

Windows 10

Additional context

Already tried opening kanata via admin mode.

@lnnks lnnks added the bug Something isn't working label May 16, 2024
@jtroo
Copy link
Owner

jtroo commented May 18, 2024

The only other things that I think might be worth trying is:

Otherwise this will probably be noted as another "Windows LLHOOK" known issue that has no workaround

@jtroo jtroo added windows Issue pertains to Windows only llhook Pertains to the standard version of Kanata on Windows labels May 18, 2024
@eugenesvk
Copy link
Contributor

As far as I understand, the reason is that cursor keys (and a few other like home/end, see below) needs to be sent slightly differently - via Scan Codes instead of Virtual Keys. At least that's how AutoHotkey does it

For example, in the same ⌘⭾ task switcher:

+vkBB::{Send("{vk26}")} ; ✗FAILS
vkBB::{Send("{sc148}")} ; ✓WORKS

This might be the list of such special keys:

Currently g_key_to_sc contains NumpadEnter, Del, Ins, Up, Down, Left, Right, Home, End, PgUp and PgDn.

from https://www.autohotkey.com/boards/viewtopic.php?f=76&t=18836&p=91282&hilit=keyboard+hook+home+end#p91282

(tested with UIA on, it doesn't help here, cursor works in the elevated task manger, but not in this non-elevated task view)

@eugenesvk
Copy link
Contributor

eugenesvk commented May 18, 2024

@lnnks can you test with the https://github.com/jtroo/kanata/releases/download/v1.6.1/kanata_scancode_experimental.exe version?

It sends scan codes for some special keys and works for me in the task view with your config

jtroo Maybe this version could be made the default in the next pre-release to force :) more testing to see if it has any issues since otherwise it's a better approach that's also used in AHK?

jtroo pushed a commit that referenced this issue May 18, 2024
#1047)

Switch to the better llhook input handling methods (only in the new
experimental gui app, so should be fine) used in winio2 to avoid issues
like #1042
@jtroo
Copy link
Owner

jtroo commented May 18, 2024

Thanks for testing with winIOv2 eugenesvk!

Maybe this version could be made the default in the next pre-release to force :) more testing to see if it has any issues since otherwise it's a better approach that's also used in AHK?

I don't think I would do it for any v1.X.Y version. Doing so is a guaranteed breaking change for anyone using a non-US layout defsrc. Hopefully scancode output without scancode input should fix the problem as well though? And that shouldn't be breaking to use as default.

@eugenesvk
Copy link
Contributor

yeah, scancode output is all that's needed

@lnnks
Copy link
Author

lnnks commented May 20, 2024

@eugenesvk thank you for your recommendation. after testing the version from https://github.com/jtroo/kanata/releases/download/v1.6.1/kanata_scancode_experimental.exe, I can confirm that this configuration works on my machine in the task view.

Additionally, as I mentioned, I have also tried the "enable in elevated windows" solution recommended by @jtroo, but unfortunately, it doesn't seem to work on my machine.

@jtroo jtroo closed this as not planned Won't fix, can't repro, duplicate, stale May 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working llhook Pertains to the standard version of Kanata on Windows windows Issue pertains to Windows only
Projects
None yet
Development

No branches or pull requests

3 participants