Skip to content

fix(windows): add apply actions call to core_event#15867

Open
rc-swag wants to merge 3 commits intofix/windows/15594/caps-lock-stores-change-filtersfrom
fix/windows/15857/caps-indicator-switched-off-select
Open

fix(windows): add apply actions call to core_event#15867
rc-swag wants to merge 3 commits intofix/windows/15594/caps-lock-stores-change-filtersfrom
fix/windows/15857/caps-indicator-switched-off-select

Conversation

@rc-swag
Copy link
Copy Markdown
Contributor

@rc-swag rc-swag commented Apr 23, 2026

The problem was actually the fact that the memset(const_cast<km_core_actions*>(&_action_struct), 0, sizeof(km_core_actions)); call in state.cpp initialisation means the object is zeroed out and results in new_caps_lock_state == KM_CORE_CAPS_OFF. This bug would have been a regresion from when we use to have an actions list. Calling apply_actions_and_merge_app_context which then calls
action_item_list_to_actions_object the top of this function sets all the actions default values.
So in this case calling it means the _action_struct is correctly initialised, event though no actions were added.

I think we should consider making a helper km::core::set_action_defaults which is called on contstruction just after the memset zeroing.

add apply_actions_and_merge_app_context to km_core_event parent. This ensures any actions as result of the km_core_event are applied and actions object updated.

Fixes:#15857

User Testing

TEST_CAPS_STAYS_ON

Use the capslock.kmp.zip keyboard.
Starting an app Word or Notepad, Keyman is running but a Non-Keyman keyboard is selected.

Press the CapsLock key verify the Caplock indicator light is on.

Select the Keyboard named Capslock without pressing any other key.
Ensuring the app still has focus verify the CapsLock Indicator remains on.

Repeat to ensure it continues to behave as expected not turning of the indicator when selecting the Capslock Keyman keyboard. Or any keyboard that doesn't have capsallwaysoff store.

TEST_CAPS_ALWAYS_OFF

Use a keyboard with the caps_always_off.kmp.zip store set
Install Caps Always Off keyboard.

Starting an app Word or Notepad, Keyman is running but a Non-Keyman keyboard is selected.

Select the Keyboard named Caps Always Off without pressing any other key.
Ensuring the app still has focus verify the CapsLock Indicator turns OFF.

Repeat to ensure it continues to behave as expected, turning of the indicator off when selecting the Caps Always off Keyman keyboard.

add apply_actions_and_merge_app_context to km_core_event parent.
This ensures any actions as result of the km_core_event are applied
and actions object updated.

Fixes:#15857
@github-project-automation github-project-automation Bot moved this to Todo in Keyman Apr 23, 2026
@keymanapp-test-bot keymanapp-test-bot Bot added the user-test-missing User tests have not yet been defined for the PR label Apr 23, 2026
@keymanapp-test-bot
Copy link
Copy Markdown

keymanapp-test-bot Bot commented Apr 23, 2026

User Test Results

Test specification and instructions

  • TEST_CAPS_STAYS_ON (OPEN)
  • TEST_CAPS_ALWAYS_OFF (OPEN)
Results Template
# Test Results

* **TEST_CAPS_STAYS_ON (OPEN):** notes
* **TEST_CAPS_ALWAYS_OFF (OPEN):** notes

Test Artifacts

@keymanapp-test-bot keymanapp-test-bot Bot added this to the A19S27 milestone Apr 23, 2026
@rc-swag rc-swag self-assigned this Apr 23, 2026
@keymanapp-test-bot keymanapp-test-bot Bot added has-user-test user-test-required User tests have not been completed and removed user-test-missing User tests have not yet been defined for the PR labels Apr 23, 2026
@rc-swag
Copy link
Copy Markdown
Contributor Author

rc-swag commented Apr 24, 2026

I have added call to the constructor because I believe construction should have the correct state.
see second commit

@rc-swag rc-swag marked this pull request as ready for review April 24, 2026 00:47
@keyman-server keyman-server modified the milestones: A19S27, A19S28 Apr 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core/ Keyman Core fix has-user-test user-test-required User tests have not been completed windows/

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

3 participants