summaryrefslogtreecommitdiffstats
path: root/osdep/mac/swift_extensions.swift
diff options
context:
space:
mode:
authorder richter <der.richter@gmx.de>2024-03-12 22:44:41 +0100
committerder richter <der.richter@gmx.de>2024-03-14 23:33:15 +0100
commit556cb7d6a4996a51bb58ecad5383eb8fdab0582a (patch)
tree9aa024762693071c5b4967d17049ec878e5f6f09 /osdep/mac/swift_extensions.swift
parent4d8ea338de2703f2d919a6cc1cf30392d2f03c3a (diff)
downloadmpv-556cb7d6a4996a51bb58ecad5383eb8fdab0582a.tar.bz2
mpv-556cb7d6a4996a51bb58ecad5383eb8fdab0582a.tar.xz
mac/input: add simplified mp_keymap init
Diffstat (limited to 'osdep/mac/swift_extensions.swift')
-rw-r--r--osdep/mac/swift_extensions.swift6
1 files changed, 6 insertions, 0 deletions
diff --git a/osdep/mac/swift_extensions.swift b/osdep/mac/swift_extensions.swift
index 004927766d..99d32644cc 100644
--- a/osdep/mac/swift_extensions.swift
+++ b/osdep/mac/swift_extensions.swift
@@ -47,6 +47,12 @@ extension NSEvent.ModifierFlags {
public static var optionRight: NSEvent.ModifierFlags = .init(rawValue: UInt(NX_DEVICERALTKEYMASK))
}
+extension mp_keymap {
+ init(_ f: Int, _ t: Int32) {
+ self.init(from: Int32(f), to: t)
+ }
+}
+
extension Bool {
init(_ int32: Int32) {
self.init(int32 != 0)