feat: support Right Control as push-to-talk key (to use with Karabiner that can emit this keycode when Spotlight or Dictation key is pressed)

This commit is contained in:
Yar Dmitriev 2025-04-13 22:22:06 +01:00
parent ba239e6418
commit 1186312ea8
3 changed files with 12 additions and 0 deletions

View File

@ -56,6 +56,7 @@ class HotkeyManager: ObservableObject {
case rightOption = "rightOption"
case leftOption = "leftOption"
case leftControl = "leftControl"
case rightControl = "rightControl"
case fn = "fn"
case rightCommand = "rightCommand"
case rightShift = "rightShift"
@ -65,6 +66,7 @@ class HotkeyManager: ObservableObject {
case .rightOption: return "Right Option (⌥)"
case .leftOption: return "Left Option (⌥)"
case .leftControl: return "Left Control (⌃)"
case .rightControl: return "Right Control (⌃)"
case .fn: return "Fn"
case .rightCommand: return "Right Command (⌘)"
case .rightShift: return "Right Shift (⇧)"
@ -76,6 +78,7 @@ class HotkeyManager: ObservableObject {
case .rightOption: return 0x3D
case .leftOption: return 0x3A
case .leftControl: return 0x3B
case .rightControl: return 0x3E
case .fn: return 0x3F
case .rightCommand: return 0x36
case .rightShift: return 0x3C
@ -87,6 +90,7 @@ class HotkeyManager: ObservableObject {
case .rightOption: return .maskAlternate
case .leftOption: return .maskAlternate
case .leftControl: return .maskControl
case .rightControl: return .maskControl
case .fn: return .maskSecondaryFn
case .rightCommand: return .maskCommand
case .rightShift: return .maskShift

View File

@ -179,6 +179,7 @@ struct RecordView: View {
case .rightOption: return ""
case .leftOption: return ""
case .leftControl: return ""
case .rightControl: return ""
case .fn: return "Fn"
case .rightCommand: return ""
case .rightShift: return ""
@ -190,6 +191,7 @@ struct RecordView: View {
case .rightOption: return "Right Option"
case .leftOption: return "Left Option"
case .leftControl: return "Left Control"
case .rightControl: return "Right Control"
case .fn: return "Function"
case .rightCommand: return "Right Command"
case .rightShift: return "Right Shift"
@ -241,6 +243,8 @@ struct RecordView: View {
keyName = "left Option (⌥)"
case .leftControl:
keyName = "left Control (⌃)"
case .rightControl:
keyName = "right Control (⌃)"
case .fn:
keyName = "Fn"
case .rightCommand:

View File

@ -262,6 +262,8 @@ struct SettingsView: View {
return "Using Left Option (⌥) key to quickly start recording. Release to stop."
case .leftControl:
return "Using Left Control (⌃) key to quickly start recording. Release to stop."
case .rightControl:
return "Using Right Control (⌃) key to quickly start recording. Release to stop."
case .fn:
return "Using Function (Fn) key to quickly start recording. Release to stop."
case .rightCommand:
@ -370,6 +372,7 @@ struct PushToTalkKeySelector: View {
case .rightOption: return ""
case .leftOption: return ""
case .leftControl: return ""
case .rightControl: return ""
case .fn: return "Fn"
case .rightCommand: return ""
case .rightShift: return ""
@ -381,6 +384,7 @@ struct PushToTalkKeySelector: View {
case .rightOption: return "Right Option"
case .leftOption: return "Left Option"
case .leftControl: return "Left Control"
case .rightControl: return "Right Control"
case .fn: return "Function"
case .rightCommand: return "Right Command"
case .rightShift: return "Right Shift"