Skip to content

Conversation

@ermshiperete
Copy link
Contributor

Fixes: #15287
Test-bot: skip

@keymanapp-test-bot
Copy link

keymanapp-test-bot bot commented Dec 11, 2025

User Test Results

Test specification and instructions

User tests are not required

Test Artifacts

  • Android
    • Keyman for Android apk - build : all tests passed (no artifacts on BuildLevel "build")
    • FirstVoices Keyboards for Android apk - build : all tests passed (no artifacts on BuildLevel "build")
    • FirstVoices Keyboards for Android apk (old PRs) - build : all tests passed (no artifacts on BuildLevel "build")
    • KeyboardHarness apk - build : all tests passed (no artifacts on BuildLevel "build")
    • Keyman for Android apk (old PRs) - build : all tests passed (no artifacts on BuildLevel "build")
    • KMSample1 apk - build : all tests passed (no artifacts on BuildLevel "build")
    • KMSample2 apk - build : all tests passed (no artifacts on BuildLevel "build")
  • Developer
    • Keyman Developer - build : all tests passed (no artifacts on BuildLevel "build")
    • Compiler Regression Tests - build : all tests passed (no artifacts on BuildLevel "build")
    • Keyman Developer (old PRs) - build : all tests passed (no artifacts on BuildLevel "build")
    • kmcomp.zip - build : all tests passed (no artifacts on BuildLevel "build")
    • kmcomp.zip (old PRs) - build : all tests passed (no artifacts on BuildLevel "build")
  • iOS
    • Keyman for iOS (simulator image) - build : all tests passed (no artifacts on BuildLevel "build")
    • FirstVoices Keyboards for iOS (simulator image) - build : all tests passed (no artifacts on BuildLevel "build")
    • FirstVoices Keyboards for iOS (simulator image) (old PRs) - build : all tests passed (no artifacts on BuildLevel "build")
    • Keyman for iOS (simulator image) (old PRs) - build : all tests passed (no artifacts on BuildLevel "build")
  • Keyboards
    • Test Keyboards - build : all tests passed (no artifacts on BuildLevel "build")
  • Web
    • KeymanWeb Test Home - build : all tests passed (no artifacts on BuildLevel "build")

@keymanapp-test-bot keymanapp-test-bot bot changed the title feat(web): implement doModifierPress feat(web): implement doModifierPress 🎼 Dec 11, 2025
@keymanapp-test-bot keymanapp-test-bot bot added this to the A19S18 milestone Dec 11, 2025
@ermshiperete ermshiperete changed the base branch from refactor/web/cleanup to refactor/web/constants December 11, 2025 18:01
@ermshiperete ermshiperete force-pushed the feat/web/15287_doModifierPress branch from 1bd3aa5 to 283f43f Compare December 11, 2025 18:05
@ermshiperete ermshiperete marked this pull request as ready for review December 11, 2025 18:06
@ermshiperete ermshiperete force-pushed the refactor/web/constants branch from 5b3ea22 to 878b8ab Compare December 11, 2025 18:28
@ermshiperete ermshiperete force-pushed the feat/web/15287_doModifierPress branch from 283f43f to 68de61a Compare December 11, 2025 18:29
@ermshiperete ermshiperete changed the title feat(web): implement doModifierPress 🎼 feat(web): implement doModifierPress ✨ 🎼 Dec 15, 2025
@keyman-server keyman-server modified the milestones: A19S18, A19S19 Dec 21, 2025
Copy link
Member

@mcdurdin mcdurdin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure about some of the modifier-related changes here, we should discuss

Comment on lines +398 to +404
if (this.activeKeyboard.isMnemonic && this.stateKeys['K_CAPS'] && (!e || !e.isModifier)) {
// Modifier keypresses don't trigger mnemonic manipulation of modifier state.
// Only an output key does; active use of Caps will also flip the SHIFT flag.
// Mnemonic keystrokes manipulate the SHIFT property based on CAPS state.
// We need to unflip them when tracking the OSK layer.
keyShiftState ^= ModifierKeyConstants.K_SHIFTFLAG;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this straight from jsKeyboardProcessor? I just don't quite understand the rationale - shift and caps have different effects on keys (e.g. 1 --> ! / 1 vs a --> A / A for shift and caps respectively)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that's from jsKeyboardProcessor:

if(this.activeKeyboard.isMnemonic && this.stateKeys['K_CAPS']) {

case Codes.keyCodes.K_RCTRL:
case Codes.keyCodes.K_LALT:
case Codes.keyCodes.K_RALT:
case Codes.keyCodes.K_ALTGR:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not a real AltGr. It's a pseudo AltGr that probably should never be used. See its keyCodes value of 50010. May need some further investigation!

Suggested change
case Codes.keyCodes.K_ALTGR:

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this apply to all keycodes > 50000? If so, what are those? And we should probably add a comment to https://github.com/keymanapp/keyman/blob/feat/web/15287_doModifierPress/common/web/types/src/consts/virtual-key-constants.ts#L130

Comment on lines 144 to 149
case Codes.keyCodes.K_LSHIFT:
case Codes.keyCodes.K_RSHIFT:
case Codes.keyCodes.K_LCTRL:
case Codes.keyCodes.K_RCTRL:
case Codes.keyCodes.K_LALT:
case Codes.keyCodes.K_RALT:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These do not currently return true, so this is a functional change which would need extensive testing. I suggest we do not add them here unless we actually have a need for them, or else we audit all uses to ensure that adding these does not break anything.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed.

{ code: Codes.keyCodes.K_NUMLOCK, name: 'NumLock' },
{ code: Codes.keyCodes.K_SCROLL, name: 'ScrollLock' },
// TODO-web-core: should LSHIFT/RSHIFT etc also be detected as modifier?
// Currently .js keyboards don't don't support distinguishing
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.js keyboards do support L/R alt and ctrl, but not L/R shift. We don't support L/R shift anywhere in Keyman.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed.

Base automatically changed from refactor/web/constants to epic/web-core December 22, 2025 13:33
@keyman-server keyman-server modified the milestones: A19S19, A19S20 Jan 3, 2026
@ermshiperete ermshiperete requested a review from mcdurdin January 6, 2026 17:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

4 participants