#keypad code check?

1 messages · Page 1 of 1 (latest)

tepid pecan
#

intended behavior is a keypad with two modifier keys to select alternate functions where defined

#

currently waiting for hardware before testing

pale cedar
#

you probably want layer = int(key[3])) otherwise it's a string

tepid pecan
#

oop

#

thanks

pale cedar
#

otherwise it does what one would expect, for now

tepid pecan
#

still trying to puzzle out a straightforward method for ignoring empty layers

pale cedar
#

you might also want to use key.startswith('mod')

tepid pecan
#

didn't know about that one

pale cedar
#

personally I don't ignore empty layers, just repeat the keys in the layer definition

tepid pecan
#

just curious: why not use key_number_to_row_column?

#

in yours

#

looks quite effective though

pale cedar
#

it didn't exist when I wrote it

tepid pecan
#

makes sense

tepid pecan
#

updated line 38, I think it should behave as intended now w.r.t. layer fall-through

pale cedar
#

ah yes

#

a bit confusing calling this "key"

#

how about "layers"

#

hmm, not good

#

then it doesn't fit with mods

tepid pecan
#

the way I think of it is that each "key" is a position on the keypad

pale cedar
#

by the way, you can't have mods on layers

tepid pecan
#

in this case, I don't intend to

pale cedar
#

I usually have "raise" and "lower" going to layer 1 and 2, and then pressing both takes me to layer 3

tepid pecan
#

I considered that, would be possible by changing line 36 to += and mirroring it on line 40 with -=

#

but this is basically "minimum viable" code for the specific project in mind, without much regard to extensibility

#

at the moment I just don't have enough stuff that I want a macro key for 😛

tepid pecan
#

thought you might be interested to hear that it seems to be working now