114
114
#define NUX_F23 NUX_VK_F23
115
115
#define NUX_F24 NUX_VK_F24
117
#define NUX_LEFT_MOUSE 1
118
#define NUX_MIDDLE_MOUSE 2
119
#define NUX_RIGHT_MOUSE 3
119
NUX_INVALID_MOUSE_BUTTON = 0,
120
NUX_MOUSE_BUTTON1 = 1,
121
NUX_MOUSE_BUTTON2 = 2,
122
NUX_MOUSE_BUTTON3 = 3,
123
NUX_MOUSE_BUTTON4 = 4,
124
NUX_MOUSE_BUTTON5 = 5,
125
NUX_MOUSE_BUTTON6 = 6,
126
NUX_LEFT_MOUSE = NUX_MOUSE_BUTTON1, // Deprecated
127
NUX_MIDDLE_MOUSE = NUX_MOUSE_BUTTON2, // Deprecated
128
NUX_RIGHT_MOUSE = NUX_MOUSE_BUTTON3, // Deprecated
121
// Key States. Set in e_key_modifiers.
122
#define NUX_STATE_SHIFT 0x00010000
123
#define NUX_STATE_CAPS_LOCK 0x00020000
124
#define NUX_STATE_CTRL 0x00040000
125
#define NUX_STATE_ALT 0x00080000
126
#define NUX_STATE_NUMLOCK 0x00100000 // most X servers do this?
127
#define NUX_STATE_META 0x00400000 // correct for XFree86
128
#define NUX_STATE_SCROLLLOCK 0x00800000 // correct for XFree86
133
NUX_STATE_SHIFT = 0x00010000,
134
NUX_STATE_CAPS_LOCK = 0x00020000,
135
NUX_STATE_CTRL = 0x00040000,
136
NUX_STATE_ALT = 0x00080000,
137
NUX_STATE_NUMLOCK = 0x00100000,
138
NUX_STATE_META = 0x00400000,
139
NUX_STATE_SCROLLLOCK = 0x00800000,
130
142
// These flags describe the mouse button responsible for the mouse event.
131
143
// They are valid only for the current frame.
203
215
NUX_DND_LEAVE_WINDOW, //!< Emitted when the DND action goes outside (XdndEnter) a window.
206
unsigned long GetEventButton(unsigned long button_state);
207
bool GetButtonState(unsigned long button_state, int button);
218
//! Returns index of the mouse button that triggered an event.
220
Given the mouse button states of and event, returns the index of the button that
221
triggered an event. The index of the left mouse button is 1 and the index for the right
222
mouse button is 2. If 0 is returned, then a mouse button didn't triggered the event.
224
@param button_state The mouse button states of an event.
225
@return The button that triggered the event.
227
MouseButton GetEventButton(unsigned long button_state);
229
//! Returns the state of a mouse button: pressed or released.
231
Given the mouse button states of and event, returns the state of a mouse button.
232
True is the button is pressed. False otherwise.
234
@param button_state The mouse button states of an event.
235
@param button Button to query (1 for left mouse button).
236
@return True is the button is pressed. False otherwise.
238
bool GetButtonState(unsigned long button_state, MouseButton button);
240
//! Returns the state of a special key: CTRL, Shift, Alt, NumLock...
242
Given the key modifiers states of and event, returns the state of a key modifier.
243
True is the key is pressed. False otherwise.
245
@param key_modifiers_state The key modifiers states of an event.
246
@param key_modifier Key modifier be query.
247
@return True is the key is pressed. False otherwise.
249
bool GetKeyModifierState(unsigned long key_modifiers_states, KeyModifier key_modifier);
209
251
#define NUX_EVENT_TEXT_BUFFER_SIZE 16
211
253
//! Nux event class.
227
269
unsigned long GetKeyState() const;
228
270
unsigned long GetMouseState() const;
231
Get the button responsible for the event.
232
@return The index of the button responsible for the event: 1 left mouse button, 2 middle mouse button, 3 right mouse button.
234
unsigned long GetEventButton() const;
237
Check if a mouse button is down.
238
@param button The button whose state is to be checked.
239
@return True if the button is down.
241
bool GetButtonState(int button) const;
272
//! Returns index of the mouse button that triggered this event.
274
Returns the index of the button that triggered this event.
275
The index of the left mouse button is 1 and the index for the right
276
mouse button is 2. If 0 is returned, then a mouse button didn't triggered the event.
278
@return The button that triggered the event.
280
MouseButton GetEventButton() const;
282
//! Returns the state of a mouse button: pressed or released.
284
Returns the state of a mouse button.
285
True is the button is pressed. False otherwise.
287
@param button_index Button index to query (1 for left mouse button).
288
@return True is the button is pressed. False otherwise.
290
bool GetButtonState(MouseButton button) const;
292
//! Returns the state of a special key: CTRL, Shift, Alt, NumLock...
294
Returns the state of a key modifier.
295
True is the key is pressed. False otherwise.
297
@param key_modifier Key modifier be query.
298
@return True is the key is pressed. False otherwise.
300
bool GetKeyModifierState(KeyModifier key_modifier) const;
245
302
//! Return virtual key code of the key that has triggered the last event.