Skip to content

Commit 3bcd919

Browse files
rc-swagmcdurdin
andauthored
feat(windows): review suggestions
Co-authored-by: Marc Durdin <[email protected]>
1 parent 85ad612 commit 3bcd919

File tree

4 files changed

+19
-20
lines changed

4 files changed

+19
-20
lines changed

core/src/kmx/kmx_processor.cpp

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -105,23 +105,22 @@ kmx_processor::update_option(
105105

106106
km_kbp_status
107107
kmx_processor::external_event(
108-
km_kbp_state* state,
109-
uint32_t event,
110-
void* _kmn_unused(data)
111-
) {
108+
km_kbp_state* state,
109+
uint32_t event,
110+
void* _kmn_unused(data)
111+
) {
112112

113-
switch (event){
114-
case KM_KBP_EVENT_KEYBOARD_ACTIVATED:{
113+
switch (event) {
114+
case KM_KBP_EVENT_KEYBOARD_ACTIVATED:
115115
// reset any current actions in the queue as a new keyboard
116116
// has been activated
117117
_kmx.GetActions()->ResetQueue();
118118
state->actions().clear();
119-
KMX_DWORD dummy_modifiers = 0;
120-
if (_kmx.GetKeyboard()->Keyboard->dwFlags & KF_CAPSALWAYSOFF) {
121-
_kmx.SetCapsLock(dummy_modifiers, FALSE, TRUE);
119+
if (_kmx.GetKeyboard()->Keyboard->dwFlags & KF_CAPSALWAYSOFF) {
120+
KMX_DWORD dummy_modifiers = 0;
121+
_kmx.SetCapsLock(dummy_modifiers, FALSE, TRUE);
122122
}
123-
}
124-
break;
123+
break;
125124
default:
126125
return KM_KBP_STATUS_INVALID_ARGUMENT;
127126
}

core/tests/unit/kmx/kmx_external_event.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@
1919
#include <iostream>
2020
#include <sstream>
2121

22-
/** This test will test the infrastructure around the external event processing
23-
* The functions tested are:
24-
* km_kbp_event with the event KM_KBP_EVENT_KEYBOARD_ACTIVATED
25-
*
22+
/**
23+
* This test will test the infrastructure around the external event processing
24+
* The functions tested are:
25+
* - km_kbp_event with the event KM_KBP_EVENT_KEYBOARD_ACTIVATED
2626
*/
2727

2828
using namespace km::kbp::kmx;
@@ -33,8 +33,8 @@ km_kbp_option_item test_env_opts[] =
3333
};
3434

3535
int error_args() {
36-
std::cerr << "kmx: Not enough arguments." << std::endl;
37-
return 1;
36+
std::cerr << "kmx: Not enough arguments." << std::endl;
37+
return 1;
3838
}
3939

4040
void test_external_event(const km::kbp::path &source_file){

windows/src/engine/keyman32/kmprocessactions.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ ProcessActionsExternalEvent() {
218218
if (!_td) {
219219
return FALSE;
220220
}
221-
// Currently the only Action handled is KM_KBP_IT_CAPSLOCK.
221+
// Currently only a subset of actions are handled.
222222
// Other actions will be added when needed.
223223
BOOL continueProcessingActions = TRUE;
224224
for (auto act = km_kbp_state_action_items(_td->lpActiveKeyboard->lpCoreKeyboardState, nullptr); act->type != KM_KBP_IT_END;

windows/src/engine/keyman32/kmprocessactions.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ BOOL ProcessActionsNonUpdatableParse(BOOL* emitKeyStroke);
3030
* This function processes the actions queued in the core processor in
3131
* the external event case. That is actions not caused by a keystroke but from selecting a
3232
* different keyboard for example.
33-
* Currently only CAPS Lock and invalidate key stroke are processed.
33+
* Currently only KM_KBP_IT_CAPSLOCK and KM_KBP_IT_INVALIDATE_CONTEXT are processed.
3434
*
35-
* @return BOOL True if actions were successfully processed
35+
* @return BOOL TRUE if actions were successfully processed
3636
*/
3737
BOOL ProcessActionsExternalEvent();
3838

0 commit comments

Comments
 (0)