summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorder richter <der.richter@gmx.de>2024-02-06 22:43:04 +0100
committerder richter <der.richter@gmx.de>2024-02-15 00:11:55 +0100
commit05d0252a30a5f6193197bc3605cf3f84004b393f (patch)
tree921c6b6329ac662eae71fa2a9045b23e7c75324d
parent0e556674dc77f6524aaa212f7e1f3874b02b163f (diff)
downloadmpv-05d0252a30a5f6193197bc3605cf3f84004b393f.tar.bz2
mpv-05d0252a30a5f6193197bc3605cf3f84004b393f.tar.xz
mac/remote: simplify repeatable key logic
-rw-r--r--osdep/macos/remote_command_center.swift8
1 files changed, 2 insertions, 6 deletions
diff --git a/osdep/macos/remote_command_center.swift b/osdep/macos/remote_command_center.swift
index 09e8e9c554..0bd97aecd8 100644
--- a/osdep/macos/remote_command_center.swift
+++ b/osdep/macos/remote_command_center.swift
@@ -141,12 +141,8 @@ class RemoteCommandCenter: NSObject {
var state = config.state
if config.type == .repeatable {
- state = MP_KEY_STATE_DOWN
- configs[event.command]?.state = MP_KEY_STATE_DOWN
- if config.state == MP_KEY_STATE_DOWN {
- state = MP_KEY_STATE_UP
- configs[event.command]?.state = MP_KEY_STATE_UP
- }
+ state = config.state == MP_KEY_STATE_DOWN ? MP_KEY_STATE_UP : MP_KEY_STATE_DOWN
+ self.configs[event.command]?.state = state
}
EventsResponder.sharedInstance().handleMPKey(config.key, withMask: Int32(state))