-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnotes.txt
More file actions
138 lines (102 loc) · 4.88 KB
/
notes.txt
File metadata and controls
138 lines (102 loc) · 4.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
+ with the keyboard low level hook and SendInput, we are working with KEYS (virtual keys, ie VK_xx),
not characters .. ie if we want to map (unshifted) key 'q' to '?',
we need to send shift-/ (?)
+ the VK_ values for a..z are A..Z, uppercase !
-> using VkKeyScanExA() seems to handle this correctly
-> NOTE, this also means doing a French layout is not easily possible !!
(again we don't output characters, but keys ..)
-> it would need to find the VK_xx code(s) from a french MS layout,
when we use our mappings, we need to have the correct MS layout active too
-> chars like 'à' that I type with a deakey + a, how to generate this ??
SendInput both ??
-> possibly use the US intl layout, it might have all required accented chars on altGr?
not really, needs dead keys
-> use azerty ?
-> build my own !!?
-> it seems like VkKeyScanExA w/o a kbdLayout parameter looks in all installed MS layouts !
-> for eg passing é while in a US layout, will correctly find / (which output é in CAFR layout)
-> not very clear behaviour .. if the CAFR layout is active VkKeyScanExA seems to actually fail !???
also à does not map correctly ? (kinda expected)
will need to try loading a kbd layout and pass it to VkKeyScanExA
-> probably works if we load and pass a KHL for french layout to VkKeyScanExA
(now using VkKeyScanA)
+ -- scancode vs VK ----
// with Windows layouts that use AltGr, right Alt actually outputs
// LCtrl + RAlt .. but with a weird scancode for LCtrl, (0x21D instead of 0x1D)
// ie we don't send exactly the same vk / scancode, it screws up and LCtrl up is never generated !!!
@A20D0B wparam: 104 vk: A2 scan: 21D dn ex flags: 00100000
@A20D0B wparam: 104 vk: A5 scan: 38 dn EX flags: 00100001
+ Note also that apparently, contrary to what I would expect,
a scancode does NOT identify a physical key, (I thought that was the definition of a scancode !!!)
-> both left and right Ctrl have the same scancode (right ones are flagged 'extended' though)
-> BUT they DO have different VKs !
-> also see nte above for AltGr's LCtrl
+ getting the scancode from the VK does not seem to be 100% possible !
UINT scancode = MapVirtualKeyExA(vk, MAPVK_VK_TO_VSC_EX, NULL);
// a few keys don't seem to properly convert to scan code (kbd specific?)
//## PrtScrn, Pause don't convert to the scancode that we received in the kbd hook event !?
-----------
+? should map keys based on both (VK & scancode), to avoid probs for eg w. AltGr,
see above
=> how to be certain I have the correct scancodes ??
-> need to learn the kbd ?? pretty annoying
-> I guess that mapping on vk_scan and ignoring unknown values should be Ok
----
+ chording
---
+ bug: sometimes stays stuck in chord building mode (when doing it on alt layer?)
(haven't happened in a while)
- also had a case of stuck alt key
- happened with Win-xx and also shift-xx on physical machine with new version !
- shift-shift for caps-lock seems to caute it maybe
++ to reproduce: right hand qwerty shift-ctrl seems to do it every time
FIXED
+ possibly use a different approach:
gather keys in a chord as they are typed,
look for a valid chord,
IF we have a valid chord,
- on either
- key up
- keydown that invalidates the current chord,
- keydown not part of steakpower
THEN use the last found chord
and then output the other key ?
+ give an error if trying to define chords before stkpower
+ 'repeat' key
+ or chord suspend key (would allow normal auto-repeat)
+ multi chars output chords:
+ bug: outut "sp" is interpreted a the SP key !!
-> make all key names uppercase?
->? use /sse dd/ to enter literal text ??
/sp/ would be "sp" not a space
/^c/ "^c" not ctrl-c
Would also permit to have spaces in output:
/this is some text/
/, / could be used to have auto space after ','
+ consonants cluster main/alt layer chords ..
maybe find other keys combo (left hand) to avoid conflicts with normal typing ?
might need to use 2keys min ? but then I probably will have conflicts with
other stuff
e.g. mtgapPLLT9.4gg-b.kbdlo:
"ste"(er)
"tha"(t)
"the"
+? possibly use order of what was typed:
- left hand indicates which layer/same key/vert
- right hand types/chords the keys IN ORDER (1st, 2nd)
which indicates 'from/to' layers
?? how to handle in code ?
[--- usage ideas
..
---]
------
+ one-shot modifier, layer (?)
(set temp 'need xyz' flag in found action key?)
+ also, sticky keys (nb: 'stickyer' was used for layers .. not needed, re-use / change code?)
+ see about how Plover handles kbd hook & text output,
possibility of using its lib ? (not a lib, and all Python)
-> this could let me have a Mac version of pqLayouts !?
+ support for French layouts !!
-> need to use SendInput as Unicode
.. so need to read Unicode file !
.. and be able to know when a char needs to be unicode (how does plover do it?)