Giter Club home page Giter Club logo

Comments (9)

wis avatar wis commented on August 23, 2024 1

Do you still need the key names? I looked up the w3c spec for KeyboardEvent which is the object type in the browser for all the keyboard events, and found a list of them.

quote from the UIEvents w3c spec document:

the complete set of key and code values defined in [UIEvents-Key] and [UIEvents-Code] (subject to platform availability)

The UIEvents-Code link in the quote links to a footnote reference at the bottom, which contains a link to another spec document: UI Events KeyboardEvent code Values, which contains tables that list all the key names.

More on event.code: KeyboardEvent.code - MDN

from kanata.

rszyma avatar rszyma commented on August 23, 2024

Not having tested yet, I would assume this works well for LLHOOK but I am less certain about Linux evdev and Interception.

on Linux (wayland) and US layout detects all keyboard keys, but no mouse keys/events

from kanata.

rszyma avatar rszyma commented on August 23, 2024

Though what would it the codes be used for? arbitrary-code? Then it shows different values on Linux e.g. the tool shows 65 for 'a' key, but evtest shows 30.

from kanata.

jtroo avatar jtroo commented on August 23, 2024

It would be used for str_to_oscode

from kanata.

jtroo avatar jtroo commented on August 23, 2024

Interesting, so the event.code field represents the underlying code that was pressed before OS desktop-level remapping. E.g. changing OS layout to dvorak does not change the code field, but does change the key field. This is consistent between Windows and Linux.

But what kanata Win-LLHOOK does today is use the equivalent of event.key in the hook function. So changing to use the equivalent of event.code by default would be a breaking change. It does seem more correct to change to that behaviour though, which is what keymapper appears to do.

from kanata.

jtroo avatar jtroo commented on August 23, 2024

I would guess switching to use scancodes should also fix this long-standing issue that I hadn't considered before.

#152

Probably worth doing! 🙂

from kanata.

jtroo avatar jtroo commented on August 23, 2024

As it turns out, unsafe { dbg!(MapVirtualKeyA(lparam.scanCode, 1)) } maps to the VK of the current layout. Not working just yet.. instead of calling this function, need to convert to the US layout.

from kanata.

jtroo avatar jtroo commented on August 23, 2024

As it turns out, unsafe { dbg!(MapVirtualKeyA(lparam.scanCode, 1)) } maps to the VK of the current layout. Not working just yet.. instead of calling this function, need to convert to the US layout.

Fixed in #871

Now still need to add the proper docs and add to str_to_oscode

from kanata.

gerhard-h avatar gerhard-h commented on August 23, 2024

BREAKING CHANGE: Add web event.code names as usable configuration key names, making them no longer usable in deflocalkeys.

I tested the feature and used successfully Numpad9, F1 (upper case) in my config - great.

Then I tried to break it
(deflocalkeys-wintercept ^ 192
(deflocalkeys-wintercept £ 186
(deflocalkeys-wintercept Lang1 186

But they all worked. :)

(deflocalkeys-wintercept ⇞ finally didn't work, but I think it is not related to this feature.

from kanata.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.