39aldo39 / klfc

Keyboard Layout Files Creator
GNU General Public License v3.0
215 stars 13 forks source link

Issue parsing KLC files, boolean conversion fails for complex layouts #16

Closed vdelau closed 5 years ago

vdelau commented 5 years ago

MSKLC will use a bitmap for determining if a key is affected by CAPS LOCK. For shift, this will be a value 1, which properly parsed into a boolean true. A more complex layout like EurKEY has this flag set for the AltGr level as well, causing the value to be 4 or 5.

The parser seems to fail on any other value then 0 or 1.

DreymaR commented 5 years ago

Quite. That's the Caps State entry, the second entry for each key not counting the scan code itself, iirc. If the AltGr+Shift glyph is a shifted version of the AltGr one, its value is OR'ed by 4 as Vdelau said.

39aldo39 commented 5 years ago

DreymaR is right, the value is OR'ed by 4 if AltGr is affected by Caps Lock. However, KLFC currently doesn't support different behavior for different levels. I fixed the parsing issue by ignoring other levels.