picofuse-objc

NXInputEvent.h
Go to the documentation of this file.
1 
6 #pragma once
8 #include <picofuse/hid/keycode.h>
9 
14 typedef enum {
16  NXKeyModifierShift = (1 << 0),
17  NXKeyModifierControl = (1 << 1),
18  NXKeyModifierAlt = (1 << 2),
19  NXKeyModifierMeta = (1 << 3),
20  NXKeyModifierCapsLock = (1 << 4),
22 
28 typedef enum {
33 } NXMovePhase;
34 
39 typedef enum {
44 
71 @interface NXInputEvent : NXObject {
72 @private
73  id _source;
74 }
75 
80 
84 - (id)source;
85 
86 @end
87 
94 @interface NXKeyEvent : NXInputEvent {
95 @private
96  uint16_t _keycode;
97  NXKeyModifiers _modifiers;
98  uint8_t _kind;
99 }
100 
105 - (uint16_t)keycode;
106 
110 - (NXKeyModifiers)modifiers;
111 
115 - (BOOL)isPressed;
116 
120 - (BOOL)isRepeat;
121 
125 - (BOOL)isReleased;
126 
127 @end
128 
139 @interface NXMoveEvent : NXInputEvent {
140 @private
141  NXPoint _point;
142  uint8_t _slot;
143  NXMovePhase _phase;
144 }
145 
149 - (NXPoint)point;
150 
154 - (uint8_t)slot;
155 
159 - (NXMovePhase)phase;
160 
161 @end
162 
173 @private
174  NXString *_name;
175  NXString *_unit;
176  float _value;
177 }
178 
183 - (NXString *)name;
184 
188 - (NXString *)unit;
189 
193 - (float)floatValue;
194 
195 @end
NXKeyModifiers
The modifier keys held, and Caps Lock, of a key event, which can be combined.
Definition: NXInputEvent.h:14
Foundation framework header.
An NXSensorEvent.
Definition: NXInputEvent.h:42
Either Shift.
Definition: NXInputEvent.h:16
What an input sends its target, which is an NXKeyEvent, an NXMoveEvent or an NXSensorEvent: one metho...
Definition: NXInputEvent.h:71
Either Meta, Command on a Mac, or Windows.
Definition: NXInputEvent.h:19
A mouse button or a finger pressed, moved while it&#39;s pressed, or released, or a mouse&#39;s pointer moved...
Definition: NXInputEvent.h:139
An NXMoveEvent.
Definition: NXInputEvent.h:41
Either Alt, or Option on a Mac.
Definition: NXInputEvent.h:18
An NXKeyEvent.
Definition: NXInputEvent.h:40
Pressed, at its point.
Definition: NXInputEvent.h:29
Either Control.
Definition: NXInputEvent.h:17
bool BOOL
A Boolean value.
Definition: runtime.h:60
NXInputEventKind kind()
Returns what kind it is, and so which class.
NXInputEventKind
What kind an input event is, and so which class.
Definition: NXInputEvent.h:39
const char * name()
Returns the name of the class.
A string of UTF-8 text.
Definition: NXString.h:53
Moved, while it&#39;s pressed.
Definition: NXInputEvent.h:30
id source()
Returns what sent it, such as an SDLWindow.
The base class for objects in the Foundation framework.
Definition: NXObject.h:28
A sensor&#39;s reading of one quantity, such as a temperature, which it sends each time it&#39;s read...
Definition: NXInputEvent.h:172
struct objc_object * id
A pointer to an instance of a class.
Definition: runtime.h:18
Released, at its point.
Definition: NXInputEvent.h:31
Caps Lock is on.
Definition: NXInputEvent.h:20
A point, in pixels from the top left.
Definition: NXGeometry.h:12
A key pressed, held so it repeats, or released.
Definition: NXInputEvent.h:94
NXMovePhase
How a move went: a mouse button or a finger pressed, moved while it&#39;s pressed, or released...
Definition: NXInputEvent.h:28
A pointer moved, with nothing pressed.
Definition: NXInputEvent.h:32