-
-
Notifications
You must be signed in to change notification settings - Fork 39k
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
Define custom keycodes/scancodes #1546
Comments
Hmm, what you see in keymap.c file within KEYMAP macro, like KC_A, KC_B are macros.
And as you can see in the above, it's expanded into a number before compilation;to a hid usage id. So what you have to do is to find the right hid usage id and put in in KEYMAP marco statement, no definition needed. In the case of linux:
I do not know much about display key but if that is hardware related, then apci might be involved as well. Good luck. |
Not sure that this would work, as it may need drivers on all systems. |
If this wouldn't work, what would a better way to do this be? |
Why is this issue closed? If it’s not an issue and there is a way to achieve what the OP was asking, could someone enlighten us? I’m searching for this answer myself and have not yet found a solution (I expect it is out there, I just haven’t found it yet). When you have an extra key and you are trying to may it to a scan code that can be passed onto the kernel, it would be best to try and choose a code that’s least likely to be utilised by the system at hand. I think I am looking for a slightly different approach in that I want to custom define my scan codes so they are nowhere near the general user space and then setup my own rules in Back to the OPs question, how/where should he achieve his desired outcome? |
In regard to the question in the OP: The keycode "XF86Display" is not all that useful - this is just what X.Org calls the action that key represents. It can map to various things depending on the hardware, including, as was mentioned above, however ACPI sends button presses to the OS/kernel. It does appear that there is a HID usage for this action ( And on Linux at least, it is recognised by the kernel: Three problems with this:
@madivad as for your problem, this is just as tricky, not just because of 3. above, but also because QMK internally constrains what keycodes it actually emits over the wire. You could modify those functions so that they accept your keycodes, but that seems a bit messy. Perhaps the best solution here would be to combine the usual |
@fauxpark Thanks very much for your reply. Very informative. I'm only very new to QMK and still waiting for my first device to arrive :) I'm quite excited to dig in after many failed attempts at using commercial macro boards and keyboards, I've figured, "stuff this, I'm making my own!" I have Hasu's USB-USB converter arriving in the next couple of days plus I have another macro board that I'm going to recycle into a custom QMK keyboard, plus I have my main board I have in mind to build. I'm very much looking forward to getting into this and having some serious fun. I don't want to choke up this issue (at least it's closed I suppose), but is there any good forums or especially IRC channels good for discussion in depth Linux evdev stuff and especially QMK? I'd love some pointers and although I've been extensively researching it, it's hard wading through an internet of dozens of distros over just as many years and filtering out what's current, what's cutting edge and what's been deprecated for aeons! lol. Any links appreciated. cheers. (and thanks for the above links and info, I didn't realise the space was so tight). |
Unfortunately I don't know a whole lot about the Linux end, but good places to ask about QMK stuff are the Discord, and the OLKB subreddit. I also thought of an easier solution: just use |
@madivad Typing
You can create a custom
...and then make these changes take effect until reboot by doing |
I'm new to QMK and have been looking through the docs and building a layout. I've also been looking though the sources trying to find a place where I can define codes that aren't defined in qmk/tmk by default.
For example, I'm looking to map a key to the display key commonly found on laptops, which is read as XF86Display under GNU/Linux. I don't see this key mentioned anywhere in the sources or the keymap list/header. Is there a place I can define this key so I can use it?
Thanks :^)
Sorry if I'm missing something obvious
The text was updated successfully, but these errors were encountered: