Comments (2)
Unfortunately, the behavior that you expected here is not actually implemented — KC_TRANSPARENT
is handled only by layer_switch_get_layer()
during the keymap lookup, and does not work when embedded inside MT()
or LT()
. So KC_TRANSPARENT
is not really a basic keycode for this kind of usage (i.e., something that could be sent directly to the host by register_code()
), even though it fits into a single byte.
And internally QMK has some other definitions of what a “basic” keycode is — e.g., IS_BASIC_KEYCODE()
and BASIC_KEYCODE_RANGE
accept only the KC_A
…KC_EXSEL
range, which does not even include the modifiers, even though they are also a part of the Keyboard usage page; but IS_QK_BASIC()
accepts the whole 0x00
…0xFF
range — i.e., anything which fits into a byte. So the issue of what is actually a basic keycode is somewhat complicated.
You may try to implement the behavior that you want in custom code — see the Intercepting Mod-Taps section for a way to change the tap function. Although you may need to be careful here — if the layer state changes between the press and release (which may happen for a tap if quick tap is enabled, which is the default), just using the current layer state to determine which keycode to register or unregister for a tap may result in stuck keys (although if you don't care about reporting holds with the quick tap feature properly, you may just call tap_code()
on press and do nothing on release, which would avoid the problem).
Implementing that behavior in core (where it would need to work in the most generic way possible) may be difficult though — the problem is that it would require two instances of the source layers cache (one which would remember the layer where the MT()
or LT()
keycode came from, and another which would remember the layer where the underlying tap keycode had been found). And there is an even worse problem — what to do if the keycode under MT(mods, KC_TRANSPARENT)
is not a basic keycode? (The existing code for mod-taps just does register_code(action.key.code)
for a tap; this won't work if the second keymap lookup replaces KC_TRANSPARENT
with a non-basic keycode.)
from qmk_firmware.
That's what I suspected. Can I submit a pull request for docs to communicate this caveat more clearly?
Thank you for your time.
from qmk_firmware.
Related Issues (20)
- [Bug] Bottom row of Corne Keyboard issues HOT 1
- [Bug] warning:The official repository does not seem to be configured as git remote "upstream". HOT 12
- [Feature Request] Custom keycodes and axies for joysticks HOT 1
- [help] QMK Doc‘s “Flashing DFU Bootloader” cannot flash APM32。 HOT 1
- [Feature Request] Add Left Control and Alt key HOT 2
- [Bug] Most rules in 50-qmk.rules are missing MODE and GROUP for non-systemd distros HOT 4
- Keys are held down and keep repeating after waking from sleep.
- [Bug] If 4 rotary encoders are specified, all rotary encoders will stop responding. HOT 6
- [Bug] Caps Word get reset by normal press with interrupting character on long press HOT 2
- [Feature Request] Password manager/generator functionality HOT 1
- [Bug] Capslock randomly trigger while typing with Sofle V2 HOT 1
- Rotary Encoders - Microsoft flight simulator - MSFS Heading, Speed, Altitude Control HOT 2
- Strange behaviour of macros with lily58 HOT 1
- Compilation of TAP DANCE fails (code compiled previously). HOT 2
- Updating STENO code from an older QMK version
- qmk msys can not convert to get file uf2, fatal error HOT 1
- [Bug] Different response of keyboard depending on key pressing speed in succesion .
- [Bug] Idobao ID75 V3 (Drop) Issue with RGB Matrix
- [Bug] xd75 doesn't build on head HOT 5
- Problem flashing dztech PCBs with lufa-ms bootloader from Linux[Bug] HOT 1
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 qmk_firmware.