There were a few minor problems in the way Consumer `Key` objects were constructed (using `CONSUMER_KEY()`). First, no masking of the high bits was being done, so it was possible to create a "Consumer" key with the `RESERVED` bit set (e.g. `Key_Transparent`), or the `SWITCH_TO_KEYMAP` bit (in fact, any `Key` value with both the `SYNTHETIC` and `IS_CONSUMER` bits set was possible). Second, the high six bits of the raw `Key` value should always be `010010` (`SYNTHETIC | IS_CONSUMER`), as Consumer keys don't have any flags. The macro should really only take one argument: a 16-bit integer keycode value. The `HID_TYPE_*` constants really shouldn't be used at all in defining the keys in key_defs_consumer.h, because setting those bits could potentially cause a key to be misidentified by some plugin. This change fixes these potential problems by ignoring the `flags` parameter, masking the high six bits of the `code` supplied, and setting those high six bits to the correct value.pull/915/head
parent
ad5031f64a
commit
5cecf381c3
Loading…
Reference in new issue