Skip to content

Commit

Permalink
feat(core): kmx+ scaffolding for modifiers=default
Browse files Browse the repository at this point in the history
- add a new value, 0x10000 to indicate 'default'

For: #11072
  • Loading branch information
srl295 committed Mar 28, 2024
1 parent 876c0e7 commit 313bbd3
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 12 deletions.
1 change: 1 addition & 0 deletions common/include/kmx_file.h
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,7 @@ namespace kmx {

#define K_MODIFIERFLAG 0x007F
#define K_NOTMODIFIERFLAG 0xFF00 // I4548
#define K_DEFAULTMODFLAG 0x10000 // used by KMX+ for the default modifier

struct COMP_STORE {
KMX_DWORD_unaligned dwSystemID;
Expand Down
3 changes: 2 additions & 1 deletion core/include/ldml/keyman_core_ldml.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,15 @@
#define LDML_FINL_FLAGS_ERROR 0x1
#define LDML_KEYS_KEY_FLAGS_EXTEND 0x1
#define LDML_KEYS_KEY_FLAGS_GAP 0x2
#define LDML_KEYS_MOD_ALL 0x17F
#define LDML_KEYS_MOD_ALL 0x1017F
#define LDML_KEYS_MOD_ALT 0x40
#define LDML_KEYS_MOD_ALTL 0x4
#define LDML_KEYS_MOD_ALTR 0x8
#define LDML_KEYS_MOD_CAPS 0x100
#define LDML_KEYS_MOD_CTRL 0x20
#define LDML_KEYS_MOD_CTRLL 0x1
#define LDML_KEYS_MOD_CTRLR 0x2
#define LDML_KEYS_MOD_DEFAULT 0x10000
#define LDML_KEYS_MOD_NONE 0x0
#define LDML_KEYS_MOD_SHIFT 0x10
#define LDML_LAYR_LIST_HARDWARE_TOUCH "touch"
Expand Down
6 changes: 6 additions & 0 deletions core/include/ldml/keyman_core_ldml.ts
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,11 @@ class Constants {
*/
readonly keys_mod_shift = 0x0010;

/**
* bitmask for 'default'.
*/
readonly keys_mod_default = 0x10000;

/**
* Convenience map for modifiers
*/
Expand All @@ -284,6 +289,7 @@ class Constants {
["ctrlL", this.keys_mod_ctrlL],
["ctrlR", this.keys_mod_ctrlR],
["shift", this.keys_mod_shift],
["default", this.keys_mod_default],
]
);

Expand Down
23 changes: 12 additions & 11 deletions core/src/ldml/C7043_ldml.md
Original file line number Diff line number Diff line change
Expand Up @@ -461,17 +461,18 @@ For each key:
by the compiler.
- `mod`: 32-bit bitfield defined as below. Little endian values.

| Value | Meaning |`kmx_file.h` | Comment |
|----------|----------|---------------|---------------------------------------------|
| 0x0000 | `none` | | All zeros = no modifiers |
| 0x0001 | `ctrlL` | `LCTRLFLAG` | Left Control |
| 0x0002 | `ctrlR` | `RCTRLFLAG` | Right Control |
| 0x0004 | `altL` | `LALTFLAG` | Left Alt |
| 0x0008 | `altR` | `RALTFLAG` | Right Alt |
| 0x0010 | `shift` | `K_SHIFTFLAG` | Either Shift |
| 0x0020 | `ctrl` | `K_CTRLFLAG` | Either Control |
| 0x0040 | `alt` | `K_ALTFLAG` | Either Alt |
| 0x0100 | `caps` | `CAPITALFLAG` | Caps lock |
| Value | Meaning |`kmx_file.h` | Comment |
|----------|-----------|--------------------|-----------------------------------------------|
| 0x0000 | `none` | | All zeros = no modifiers |
| 0x0001 | `ctrlL` | `LCTRLFLAG` | Left Control |
| 0x0002 | `ctrlR` | `RCTRLFLAG` | Right Control |
| 0x0004 | `altL` | `LALTFLAG` | Left Alt |
| 0x0008 | `altR` | `RALTFLAG` | Right Alt |
| 0x0010 | `shift` | `K_SHIFTFLAG` | Either Shift |
| 0x0020 | `ctrl` | `K_CTRLFLAG` | Either Control |
| 0x0040 | `alt` | `K_ALTFLAG` | Either Alt |
| 0x0100 | `caps` | `CAPITALFLAG` | Caps lock |
| 0x10000 | `default` | `K_DEFAULTMODFLAG` | Default (not used in conjunction with others) |

TODO-LDML: Note that conforming to other keyman values, left versus right shift
cannot be distinguished.
Expand Down

0 comments on commit 313bbd3

Please sign in to comment.