UFO: Alien Invasion
Main Page
Related Pages
Modules
Namespaces
Data Structures
Files
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Modules
Pages
ui_input.h
Go to the documentation of this file.
1
5
/*
6
Copyright (C) 2002-2020 UFO: Alien Invasion.
7
8
This program is free software; you can redistribute it and/or
9
modify it under the terms of the GNU General Public License
10
as published by the Free Software Foundation; either version 2
11
of the License, or (at your option) any later version.
12
13
This program is distributed in the hope that it will be useful,
14
but WITHOUT ANY WARRANTY; without even the implied warranty of
15
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16
17
See the GNU General Public License for more details.
18
19
You should have received a copy of the GNU General Public License
20
along with this program; if not, write to the Free Software
21
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22
23
*/
24
25
#pragma once
26
27
/* prototype */
28
struct
uiNode_t
;
29
30
#define UI_MAX_KEYBINDING 128
31
32
typedef
struct
uiKeyBinding_s
{
33
uiNode_t
*
node
;
34
const
struct
value_s
*
property
;
35
int
key
;
36
const
char
*
description
;
37
bool
inherited
;
38
struct
uiKeyBinding_s
*
next
;
39
}
uiKeyBinding_t
;
40
41
void
UI_SetKeyBinding
(
const
char
* path,
int
key
,
const
char
*
description
);
42
43
/* mouse input */
44
void
UI_MouseScroll
(
int
deltaX,
int
deltaY);
45
void
UI_MouseMove
(
int
x,
int
y);
46
void
UI_MouseDown
(
int
x,
int
y,
int
button);
47
void
UI_MouseUp
(
int
x,
int
y,
int
button);
48
void
UI_InvalidateMouse
(
void
);
49
bool
UI_CheckMouseMove
(
void
);
50
uiNode_t
*
UI_GetHoveredNode
(
void
);
51
void
UI_ResetInput
(
void
);
52
53
/* focus */
54
void
UI_RequestFocus
(
uiNode_t
*
node
);
55
bool
UI_HasFocus
(
uiNode_t
const
*
node
);
56
void
UI_RemoveFocus
(
void
);
57
bool
UI_KeyRelease
(
unsigned
int
key
,
unsigned
short
unicode
);
58
bool
UI_KeyPressed
(
unsigned
int
key
,
unsigned
short
unicode
);
59
int
UI_GetKeyBindingCount
(
void
);
60
uiKeyBinding_t
*
UI_GetKeyBindingByIndex
(
int
index
);
61
62
/* mouse capture */
63
uiNode_t
*
UI_GetMouseCapture
(
void
);
64
void
UI_SetMouseCapture
(
uiNode_t
*
node
);
65
void
UI_MouseRelease
(
void
);
66
67
/* all inputs */
68
void
UI_ReleaseInput
(
void
);
UI_InvalidateMouse
void UI_InvalidateMouse(void)
Force to invalidate the mouse position and then to update hover nodes...
Definition:
ui_input.cpp:560
UI_GetKeyBindingCount
int UI_GetKeyBindingCount(void)
Definition:
ui_input.cpp:272
UI_HasFocus
bool UI_HasFocus(uiNode_t const *node)
check if a node got the focus
Definition:
ui_input.cpp:230
uiKeyBinding_s
Definition:
ui_input.h:32
uiKeyBinding_s::property
const struct value_s * property
Definition:
ui_input.h:34
uiKeyBinding_s::description
const char * description
Definition:
ui_input.h:36
UI_RequestFocus
void UI_RequestFocus(uiNode_t *node)
request the focus for a node
Definition:
ui_input.cpp:206
uiKeyBinding_t
struct uiKeyBinding_s uiKeyBinding_t
unicode
unsigned short unicode
Definition:
cl_input.cpp:69
UI_ResetInput
void UI_ResetInput(void)
Definition:
ui_input.cpp:538
UI_SetKeyBinding
void UI_SetKeyBinding(const char *path, int key, const char *description)
Set a binding from a key to a node to active.
Definition:
ui_input.cpp:362
uiKeyBinding_s::next
struct uiKeyBinding_s * next
Definition:
ui_input.h:38
UI_KeyRelease
bool UI_KeyRelease(unsigned int key, unsigned short unicode)
Called by the client when the user released a key.
Definition:
ui_input.cpp:413
value_s
Definition:
scripts.h:168
key
unsigned int key
Definition:
cl_input.cpp:68
UI_GetHoveredNode
uiNode_t * UI_GetHoveredNode(void)
Get the current hovered node.
Definition:
ui_input.cpp:552
UI_MouseScroll
void UI_MouseScroll(int deltaX, int deltaY)
Called when we are in UI mode and scroll via mousewheel.
Definition:
ui_input.cpp:756
uiNode_t
Atomic structure used to define most of the UI.
Definition:
ui_nodes.h:80
uiKeyBinding_s::node
uiNode_t * node
Definition:
ui_input.h:33
index
QGL_EXTERN GLuint index
Definition:
r_gl.h:110
UI_MouseDown
void UI_MouseDown(int x, int y, int button)
Called when we are in UI mode and down a mouse button.
Definition:
ui_input.cpp:801
UI_MouseUp
void UI_MouseUp(int x, int y, int button)
Called when we are in UI mode and up a mouse button.
Definition:
ui_input.cpp:839
UI_KeyPressed
bool UI_KeyPressed(unsigned int key, unsigned short unicode)
Called by the client when the user type a key.
Definition:
ui_input.cpp:430
UI_GetMouseCapture
uiNode_t * UI_GetMouseCapture(void)
Return the captured node.
Definition:
ui_input.cpp:508
uiKeyBinding_s::key
int key
Definition:
ui_input.h:35
UI_ReleaseInput
void UI_ReleaseInput(void)
Release all captured input (keyboard or mouse)
Definition:
ui_input.cpp:496
UI_GetKeyBindingByIndex
uiKeyBinding_t * UI_GetKeyBindingByIndex(int index)
Definition:
ui_input.cpp:277
uiKeyBinding_s::inherited
bool inherited
Definition:
ui_input.h:37
UI_MouseRelease
void UI_MouseRelease(void)
Release the captured node.
Definition:
ui_input.cpp:526
UI_CheckMouseMove
bool UI_CheckMouseMove(void)
Call mouse move only if the mouse position change.
Definition:
ui_input.cpp:569
UI_SetMouseCapture
void UI_SetMouseCapture(uiNode_t *node)
Captured the mouse into a node.
Definition:
ui_input.cpp:516
UI_RemoveFocus
void UI_RemoveFocus(void)
Definition:
ui_input.cpp:241
UI_MouseMove
void UI_MouseMove(int x, int y)
Is called every time the mouse position change.
Definition:
ui_input.cpp:588
src
client
ui
ui_input.h
Generated on Mon Feb 24 2020 05:28:05 for UFO: Alien Invasion by
1.8.8