Skip to content

Commit

Permalink
Merge pull request #98441 from Yelloween10/fix-modifier-mask
Browse files Browse the repository at this point in the history
Fix incorrect `KEY_MODIFIER_MASK` value
  • Loading branch information
Repiteo committed Dec 23, 2024
2 parents 98c3138 + 0153cb8 commit b97c8b3
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion core/os/keyboard.h
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ enum class Key {

enum class KeyModifierMask {
CODE_MASK = ((1 << 23) - 1), ///< Apply this mask to any keycode to remove modifiers.
MODIFIER_MASK = (0x7F << 22), ///< Apply this mask to isolate modifiers.
MODIFIER_MASK = (0x7F << 24), ///< Apply this mask to isolate modifiers.
//RESERVED = (1 << 23),
CMD_OR_CTRL = (1 << 24),
SHIFT = (1 << 25),
Expand Down
2 changes: 1 addition & 1 deletion doc/classes/@GlobalScope.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2365,7 +2365,7 @@
<constant name="KEY_CODE_MASK" value="8388607" enum="KeyModifierMask" is_bitfield="true">
Key Code mask.
</constant>
<constant name="KEY_MODIFIER_MASK" value="532676608" enum="KeyModifierMask" is_bitfield="true">
<constant name="KEY_MODIFIER_MASK" value="2130706432" enum="KeyModifierMask" is_bitfield="true">
Modifier key mask.
</constant>
<constant name="KEY_MASK_CMD_OR_CTRL" value="16777216" enum="KeyModifierMask" is_bitfield="true">
Expand Down
7 changes: 7 additions & 0 deletions misc/extension_api_validation/4.3-stable.expected
Original file line number Diff line number Diff line change
Expand Up @@ -261,3 +261,10 @@ Validate extension JSON: Error: Field 'classes/PointLight2D/properties/texture':

Property hints modified to disallow resource types that don't work. The types allowed are now more restricted, but this change only impacts the editor and not the actual exposed API. No adjustments should be necessary.
Decal properties were previously changed from Texture to Texture2D in 4.2, so we need to silence those warnings too.


GH-98441
--------
Validate extension JSON: Error: Field 'global_enums/KeyModifierMask/values/KEY_MODIFIER_MASK': value changed value in new API, from 5.32677e+08 to 2130706432.

Key modifier mask value corrected. API change documented for compatibility.

0 comments on commit b97c8b3

Please sign in to comment.