Address Sonar findings and move noise to direct dependency

This commit is contained in:
Viktor Liu
2026-05-21 17:55:27 +02:00
parent ee348ba007
commit 5e67febf57
4 changed files with 35 additions and 27 deletions
+17 -14
View File
@@ -465,23 +465,26 @@ func postFnFlagsChanged(src uintptr, fnOn bool) {
cfRelease(event)
}
// fnShiftedKeycodes are the Apple navigation/edit keys that hardware produces
// with the Fn modifier held.
var fnShiftedKeycodes = map[uint16]struct{}{
0x72: {}, // Help / Insert
0x73: {}, // Home
0x74: {}, // PageUp
0x75: {}, // ForwardDelete
0x77: {}, // End
0x79: {}, // PageDown
0x7B: {}, // Left
0x7C: {}, // Right
0x7D: {}, // Down
0x7E: {}, // Up
}
// isFnShiftedKeycode reports whether keycode is one of the Apple
// navigation/edit keys that hardware produces with the Fn modifier held.
func isFnShiftedKeycode(keycode uint16) bool {
switch keycode {
case 0x72, // Help / Insert
0x73, // Home
0x74, // PageUp
0x75, // ForwardDelete
0x77, // End
0x79, // PageDown
0x7B, // Left
0x7C, // Right
0x7D, // Down
0x7E: // Up
return true
}
return false
_, ok := fnShiftedKeycodes[keycode]
return ok
}
// InjectPointer simulates mouse movement and button events.
+1 -1
View File
@@ -1038,7 +1038,7 @@ func (s *Server) acquireAttachSession() (ScreenCapturer, func()) {
cc.ClientConnect()
return s.capturer, cc.ClientDisconnect
}
return s.capturer, func() {}
return s.capturer, func() { /* capturer has no per-client disconnect hook */ }
}
// modeString returns a human-readable session mode name.