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
Is it possible to override modifier behaviours? #233
Comments
|
I think it is possible if you write C code in keymap file. Yes, not documented. You'll have to read code. |
|
Thanks for the swift reply, it seems I will have to dive deeper to achieve what I want :) |
|
I tried to write code for the first and third of your example. This will not be exactly what you want but it will be useful as starting point. This uses functions from common/action.h and action_util.h, which are unfortunately not documented well and not designed elaborately. |
|
Thanks a lot, it indeed looks like a good starting point One question, I'm guessing things are synchronous and the keyboard is unusable in that 3ms waited, is that correct? For example, is it possible to wait 2000ms, type some stuff, and after 2000ms have those things registered I'm asking question to understand whether output is directly tied to the input, or whether the output has it's own queue |
|
Yes, during execution of action_function() keyboard is not responsive, namely it doesn't scan switch matrix. You may want to do things there as quickly as possible. TMK has no queue or suchlike and keyboard is blocked for 2000ms when using wait_ms(2000). |
|
I understand Off topic, have you ever considered separating the input and output logic to potentially make the keyboards more robust, the keyboard could register and process input while the output could progress at it's own pace, so similar to a scan loop, there could be an output loop Initially, without any added feature or fancy stuff, it should be simple to do and it shouldn't affect the existing expected behaviour of the firmware but rather remove the bottlenecks In this scenario, wait_ms would just make the output routine skip until the deadline has passed and during that duration the keypress state wouldn't change but the input/scan logic would continue to function |
|
I don't have plan to implement framework like such, but interesting and useful in some situation. |
|
Thanks so much for sharing this method, it's a bit tedious to override each key with a function, but at least it enables me to do what I want #include "action_util.h" was needed for keyboard_report by the way -- Can it be ensured that this routine is triggered only for one modifier by the way, like Ctrl+I but not Alt+Ctrl+I or Shift+Ctrl+I |
For example:
Convert Shift+Esc to a pure ~
Convert Alt+I to F13+delay+I+delay+F13
Convert Ctrl+[ to F12 while keeping Ctrl+C as Ctrl+C etc.
While also keeping the regular Shift/Alt/Ctrl behaviours
This requires momentarily sending keyup's and sending keydown's after the combo is completed, I'm not sure whether tmk_keyboard supports this, if it does, I'm probably going to switch from the infinity firmware to tmk_keyboard
(I've read the docs, but couldn't find anything specific)
Thanks in Advance
The text was updated successfully, but these errors were encountered: