Comments (9)
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.
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.
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.
It would be used for str_to_oscode
from kanata.
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.
I would guess switching to use scancodes should also fix this long-standing issue that I hadn't considered before.
Probably worth doing! 🙂
from kanata.
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.
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.
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)
- Upstream forked keyberon changes? HOT 1
- Feature request: Interception as a seperated OS HOT 10
- Feature request: be able to perform an action when sldr ends unsuccessfully HOT 4
- Bug: remapping arrow keys and sixpack results inn numberpad keys being pressed. HOT 4
- Bug: PrintScreen not triggering HOT 6
- Feature request: RPM SPEC file HOT 2
- Why doesn't `C-S-mlft` (open link in new tab and move to that tab in Chrome) work when mapped to anything? HOT 2
- Feature request: AHK style hotstrings HOT 2
- kanata.service error finding config file HOT 4
- Feature request: Accessible output messages HOT 9
- Feature request: Reverse the release order of (multi) keys
- Bug: unmod-ing modded keys not possible ({, }, !, $, etc.) HOT 3
- [minor] Prefix a new line after some secs idling in the debug log HOT 2
- Bug: "switch" & "not" operator not working HOT 6
- Bug: kanata interception gui executable does not use interception HOT 1
- Bug: Unable to find a keyboard device HOT 2
- Bug: Ctrl Shift W doesnt work in remapper ctrl key. HOT 3
- Bug: Second character of macro disappears when it is used in chord HOT 5
- help: remap fn key nixos-asahi m1 HOT 1
- Bug: tap-hold-press and tap-hold-release do not work on Linux HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kanata.