From 20883fb21acbf552fd31df13671a474b236d7331 Mon Sep 17 00:00:00 2001 From: John Benediktsson Date: Sat, 19 Mar 2016 12:48:42 -0700 Subject: [PATCH] ui.backend.cocoa.views: add constants for modifier flags. --- basis/ui/backend/cocoa/views/views.factor | 26 +++++++++++++++-------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/basis/ui/backend/cocoa/views/views.factor b/basis/ui/backend/cocoa/views/views.factor index ab6b7add8e..25b43594ed 100644 --- a/basis/ui/backend/cocoa/views/views.factor +++ b/basis/ui/backend/cocoa/views/views.factor @@ -4,10 +4,10 @@ USING: accessors alien alien.c-types alien.data alien.strings arrays assocs cocoa cocoa.application cocoa.classes cocoa.pasteboard cocoa.runtime cocoa.subclassing cocoa.types cocoa.views combinators core-foundation.strings core-graphics -core-graphics.types core-text io.encodings.utf8 kernel locals -math math.rectangles namespaces opengl sequences threads +core-graphics.types core-text io.encodings.utf8 kernel literals +locals math math.rectangles namespaces opengl sequences threads ui.gadgets ui.gadgets.private ui.gadgets.worlds ui.gestures -ui.private ; +ui.private unicode.case ; IN: ui.backend.cocoa.views : send-mouse-moved ( view event -- ) @@ -24,12 +24,20 @@ IN: ui.backend.cocoa.views [ ] } case ; -CONSTANT: modifiers - { - { S+ 0x20000 } - { C+ 0x40000 } - { A+ 0x100000 } - { M+ 0x80000 } +CONSTANT: NSAlphaShiftKeyMask 0x10000 +CONSTANT: NSShiftKeyMask 0x20000 +CONSTANT: NSControlKeyMask 0x40000 +CONSTANT: NSAlternateKeyMask 0x80000 +CONSTANT: NSCommandKeyMask 0x100000 +CONSTANT: NSNumericPadKeyMask 0x200000 +CONSTANT: NSHelpKeyMask 0x400000 +CONSTANT: NSFunctionKeyMask 0x800000 + +CONSTANT: modifiers { + { S+ $ NSShiftKeyMask } + { C+ $ NSControlKeyMask } + { A+ $ NSCommandKeyMask } + { M+ $ NSAlternateKeyMask } } CONSTANT: key-codes