houmain / keymapper

A cross-platform context-aware key remapper.
GNU General Public License v3.0
257 stars 21 forks source link

Virtual not working and remapping key as modifier not working #115

Closed kbilsted closed 3 months ago

kbilsted commented 3 months ago

I may quite well have misunderstood something. But here goes

given the following (crazy remap)

1>> Q
2>> W
3>> E
4>> R
5>> T
6>> Y
7>> U
8>> I
9>> O
0>> P
Minus >> 'å'
Equal >> '~' 

Q           >> A
W           >> S
E           >> D
R           >> F
T           >> G
Y           >> H
U           >> J
I           >> K
O           >> L
P           >> 'æ'
BracketLeft >> 'ø'

A >> Z
S >> X
D >> C
F >> V
G >> B
H >> N
J >> M
K >> Comma
L >> Period

When using virtual keys I cannot type digits, instead letters are typed as though i am not holding down m

M  >> Virtual1  
Virtual1{Q} >> 1
Virtual1{W} >> 2
Virtual1{E} >> 3
Virtual1{R} >> 4
Virtual1{T} >> 5
Virtual1{Y} >> 6
Virtual1{U} >> 7
Virtual1{I} >> 8
Virtual1{O} >> 9
Virtual1{P} >> 0

if I instead map m directly

M{Q} >> 1
M{W} >> 2
M{E} >> 3
M{R} >> 4
M{T} >> 5
M{Y} >> 6
M{U} >> 7
M{I} >> 8
M{O} >> 9
M{P} >> 0

I can type digits, but after typing the first digit, I'm guessing key-up M is also sent since subsequent digits become letters (since it does not register that I have kept holding m down). E.g. the sequence down-M down-Q down-W types 1s. Now this is useful for one-shot layers... So perhaps a mechanism for both behaviours are needed.

I'm not sure if I'm on the path to insanity - I was having fun reducing the number of keys to use on my keyboard ;)

kbilsted commented 3 months ago

Perhaps I've figured it out. I Think the issue revolves around ordering. At the top I redefine the base keys and afterwards I combine them with modifiers. Thus creating some confusing result. Is there a way to get some debug log to be able to track how it evaluates input and sends output. The verbose mode does not print much of this sort of information.

Let me play around with it a bit more before you sink your time into resolving it.

ristomatti commented 3 months ago

@kbilsted I'm not sure what the Windows equivalent would be but on Linux I can do something like this to debug:

F1 >> $(echo "keypress F1" >> keymapper-debug.log) A

Next release version will contain two features that will greatly help in debugging: https://github.com/houmain/keymapper/issues/91#issuecomment-1946504547.

As an example, the above could be made more convenient:

debug = $(echo "$0" >> keymapper-debug.log)

F1 >> debug["keypress F1"] A
kbilsted commented 3 months ago

Many thanks @ristomatti . Perhaps we should add it to the readme.. at least until better debug capabilities are implemented