Skip to content

Commit 03b68e9

Browse files
committed
consider caps lock for shift+click
1 parent c5705a1 commit 03b68e9

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/controller.swift

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ struct SyncResponse: Codable {
1313
let accepted: Bool
1414
}
1515

16+
let capsLock = 65536
17+
let shift = 131072
18+
1619
class FcitxInputController: IMKInputController {
1720
var uuid: ICUUID
1821
var appId: String
@@ -108,9 +111,9 @@ class FcitxInputController: IMKInputController {
108111
selection = newSelection
109112
var isShiftPress = false
110113
if code == 56 || code == 60 {
111-
if modsVal == 131072 {
114+
if modsVal == shift || modsVal == (shift | capsLock) {
112115
isShiftPress = true
113-
} else if modsVal == 0 && lastEventIsShiftPress && selectionChanged {
116+
} else if (modsVal == 0 || modsVal == capsLock) && lastEventIsShiftPress && selectionChanged {
114117
// Shift release following press when text selection is changed.
115118
// Send a no-op key event to fcitx so that Shift+Click doesn't trigger im toggle.
116119
process_key(uuid, 0, 0, 0, false, false)

0 commit comments

Comments
 (0)