Hi,
I’m trying to make a layer for a mobile keyboard. I have a default layer, a layer named ‘fya’, and another layer named ‘fyya’. I also have a bunch of one-to-one mappings later in my code from Latin to this script, which I believe works fine because the mobile (and PC) keyboards work. My issue is with the layers specifically.
- The default layer has K_Q unassigned. When the user input’s K_F, I want the glyph on K_F to be produced and the keyboard layer to turn to ‘fya’.
- layer_fya labels K_Q with a new glyph, and the rest of the keyboard remains the same. If the user now presses K_Q, the previously outputted glyph should be replaced by the glyph on K_Q, and the layer turns to layer_fyya
- layer_fyya has a different K_Q glyph. If the user inputs K_Q again that glyph is produced in place of whatever has been outputted already, and the layer turns to the default layer now.
My issue is that the outputs all work for these key combinations(i.e, ‘f’, ‘fq’, ‘fqq’), but once I click ‘f’, typing any other letter other than ‘q’ outputs nothing but the default layer returns. I want the other letters to be outputted and the default layer to return.
This is my code:
I thought that
context
would output the inputted key before the set()
would switch to the indicated layer, but I think set()
is taking precedence and ignoring the context
.
Do you know you would resolve this with my existing code, or would I have to reformat everything? Here is a zip of my source folder if it’s more helpful:
source.zip (588.5 KB)