Go to the source code of this file.
Data Structures | |
struct | uiKeyBinding_s |
Defines | |
#define | UI_MAX_KEYBINDING 128 |
Typedefs | |
typedef struct uiKeyBinding_s | uiKeyBinding_t |
Functions | |
void | UI_SetKeyBinding (const char *path, int key) |
void | UI_MouseWheel (qboolean down, int x, int y) |
Called when we are in UI mode and scroll via mousewheel. | |
void | UI_MouseMove (int x, int y) |
Is called every time the mouse position change. | |
void | UI_MouseDown (int x, int y, int button) |
Called when we are in UI mode and down a mouse button. | |
void | UI_MouseUp (int x, int y, int button) |
Called when we are in UI mode and up a mouse button. | |
void | UI_InvalidateMouse (void) |
Force to invalidate the mouse position and then to update hover nodes... | |
qboolean | UI_CheckMouseMove (void) |
Call mouse move only if the mouse position change. | |
struct uiNode_s * | UI_GetHoveredNode (void) |
Get the current hovered node. | |
void | UI_RequestFocus (struct uiNode_s *node) |
request the focus for a node | |
qboolean | UI_HasFocus (const struct uiNode_s *node) |
void | UI_RemoveFocus (void) |
qboolean | UI_KeyPressed (unsigned int key, unsigned short unicode) |
Called by the client when the user type a key. | |
int | UI_GetKeyBindingCount (void) |
uiKeyBinding_t * | UI_GetKeyBindingByIndex (int index) |
struct uiNode_s * | UI_GetMouseCapture (void) |
Return the captured node. | |
void | UI_SetMouseCapture (struct uiNode_s *node) |
Captured the mouse into a node. | |
void | UI_MouseRelease (void) |
Release the captured node. | |
void | UI_ReleaseInput (void) |
Release all captured input (keyboard or mouse). |
Definition in file ui_input.h.
#define UI_MAX_KEYBINDING 128 |
Definition at line 31 of file ui_input.h.
Referenced by UI_AllocStaticKeyBinding().
typedef struct uiKeyBinding_s uiKeyBinding_t |
qboolean UI_CheckMouseMove | ( | void | ) |
Call mouse move only if the mouse position change.
Definition at line 439 of file ui_input.c.
References uiNode_s::invis, mousePosX, mousePosY, oldMousePosX, oldMousePosY, qfalse, qtrue, UI_CheckVisibility(), UI_InvalidateMouse(), and UI_MouseMove().
Referenced by UI_Draw().
struct uiNode_s* UI_GetHoveredNode | ( | void | ) | [read] |
Get the current hovered node.
Definition at line 422 of file ui_input.c.
Referenced by UI_Draw(), and UI_IsPointOnWindow().
uiKeyBinding_t* UI_GetKeyBindingByIndex | ( | int | index | ) |
Definition at line 238 of file ui_input.c.
References uiGlobal_s::keyBindings, and ui_global.
Referenced by Key_WriteBindings().
int UI_GetKeyBindingCount | ( | void | ) |
Definition at line 233 of file ui_input.c.
References uiGlobal_s::numKeyBindings, and ui_global.
Referenced by Key_WriteBindings().
struct uiNode_s* UI_GetMouseCapture | ( | void | ) | [read] |
Return the captured node.
Definition at line 386 of file ui_input.c.
Referenced by UI_BaseInventoryNodeMouseUp(), UI_ContainerNodeMouseUp(), UI_EditorNodeDrawOverWindow(), UI_EditorNodeMouseDown(), UI_EditorNodeMouseUp(), UI_FocusExecuteActionNode(), UI_FocusNextActionNode(), UI_IsPointOnWindow(), UI_KeyPressed(), UI_ModelNodeMouseUp(), UI_RemoveFocus(), UI_SelectBoxNodeClick(), UI_SelectBoxNodeDraw(), UI_VScrollbarNodeDraw(), and UI_VScrollbarNodeMouseUp().
void UI_InvalidateMouse | ( | void | ) |
Force to invalidate the mouse position and then to update hover nodes...
Definition at line 430 of file ui_input.c.
References oldMousePosX, and oldMousePosY.
Referenced by UI_CheckMouseMove(), UI_CloseWindowByRef(), UI_DeleteWindowFromStack(), UI_DNDAbort(), UI_DNDDrop(), UI_MouseRelease(), UI_PushWindowDelete(), and UI_Reinit().
qboolean UI_KeyPressed | ( | unsigned int | key, | |
unsigned short | unicode | |||
) |
Called by the client when the user type a key.
[in] | key | key code, either K_ value or lowercase ascii |
[in] | unicode | translated meaning of keypress in unicode |
Definition at line 316 of file ui_input.c.
References uiNode_s::behaviour, K_ENTER, K_ESCAPE, K_KP_ENTER, K_TAB, uiBehaviour_s::keyPressed, qfalse, qtrue, UI_DNDAbort(), UI_DNDIsDragging(), UI_FocusExecuteActionNode(), UI_FocusNextActionNode(), UI_GetLastFullScreenWindow(), UI_GetMouseCapture(), ui_global, UI_KeyPressedInWindow(), UI_MouseRelease(), UI_PopWindowWithEscKey(), UI_WindowIsModal(), uiGlobal_s::windowStack, and uiGlobal_s::windowStackPos.
Referenced by Key_Event().
void UI_MouseDown | ( | int | x, | |
int | y, | |||
int | button | |||
) |
Called when we are in UI mode and down a mouse button.
Definition at line 662 of file ui_input.c.
References uiNode_s::behaviour, K_MOUSE1, K_MOUSE2, K_MOUSE3, uiBehaviour_s::mouseDown, uiNode_s::root, UI_LeftClick(), UI_MiddleClick(), UI_MoveWindowOnTop(), UI_PlaySound(), and UI_RightClick().
Referenced by CL_LeftClickDown_f(), CL_MiddleClickDown_f(), and CL_RightClickDown_f().
void UI_MouseMove | ( | int | x, | |
int | y | |||
) |
Is called every time the mouse position change.
Definition at line 458 of file ui_input.c.
References uiNode_s::behaviour, uiBehaviour_s::capturedMouseMove, uiBehaviour_s::mouseMove, uiNode_s::onMouseEnter, uiNode_s::onMouseLeave, uiNode_s::parent, qfalse, qtrue, uiNode_s::state, UI_DNDIsDragging(), UI_ExecuteEventActions(), and UI_GetNodeAtPosition().
Referenced by UI_CheckMouseMove().
void UI_MouseRelease | ( | void | ) |
Release the captured node.
Definition at line 404 of file ui_input.c.
References uiNode_s::behaviour, uiBehaviour_s::capturedMouseLost, and UI_InvalidateMouse().
Referenced by UI_BarNodeMouseUp(), UI_BaseInventoryNodeCapturedMouseMove(), UI_BaseInventoryNodeMouseUp(), UI_ContainerNodeCapturedMouseMove(), UI_ContainerNodeMouseUp(), UI_ControlsNodeMouseUp(), UI_EditorNodeMouseDown(), UI_EditorNodeStop(), UI_KeyPressed(), UI_MapNodeMouseUp(), UI_ModelNodeMouseUp(), UI_RadarNodeMouseUp(), UI_ReleaseInput(), UI_SelectBoxNodeClick(), UI_SpinnerNodeUp(), UI_VScrollbarNodeMouseUp(), and UI_ZoneNodeUp().
void UI_MouseUp | ( | int | x, | |
int | y, | |||
int | button | |||
) |
Called when we are in UI mode and up a mouse button.
Definition at line 699 of file ui_input.c.
References uiNode_s::behaviour, and uiBehaviour_s::mouseUp.
Referenced by CL_LeftClickUp_f(), CL_MiddleClickUp_f(), and CL_RightClickUp_f().
void UI_MouseWheel | ( | qboolean | down, | |
int | x, | |||
int | y | |||
) |
Called when we are in UI mode and scroll via mousewheel.
Definition at line 631 of file ui_input.c.
References uiNode_s::behaviour, uiBehaviour_s::mouseWheel, uiNode_s::onWheel, uiNode_s::onWheelDown, uiNode_s::onWheelUp, and UI_ExecuteEventActions().
Referenced by CL_ZoomInQuant_f(), and CL_ZoomOutQuant_f().
void UI_ReleaseInput | ( | void | ) |
Release all captured input (keyboard or mouse).
Definition at line 374 of file ui_input.c.
References UI_DNDAbort(), UI_DNDIsDragging(), UI_MouseRelease(), and UI_RemoveFocus().
Referenced by IN_Frame(), Key_SetDest(), UI_CloseWindowByRef(), UI_PushWindowDelete(), and UI_Reinit().
void UI_RemoveFocus | ( | void | ) |
Definition at line 200 of file ui_input.c.
References uiNode_s::behaviour, uiBehaviour_s::focusLost, and UI_GetMouseCapture().
Referenced by UI_FocusNextActionNode(), UI_KeyBindingNodeKeyPressed(), UI_ReleaseInput(), and UI_TextEntryNodeKeyPressed().
void UI_RequestFocus | ( | struct uiNode_s * | node | ) |
request the focus for a node
Definition at line 163 of file ui_input.c.
References uiNode_s::behaviour, uiBehaviour_s::focusGained, and uiBehaviour_s::focusLost.
Referenced by UI_KeyBindingNodeClick(), UI_TextEntryNodeClick(), and UI_TextEntryNodeFocus().
void UI_SetKeyBinding | ( | const char * | path, | |
int | key | |||
) |
check: only one binding per nodes
check: key per window must be unique
check: key used into UI_KeyPressed can't be used
Definition at line 248 of file ui_input.c.
References binding, Com_Error(), Com_Printf(), ERR_FATAL, uiNode_s::key, uiKeyBinding_s::key, uiKeyBinding_s::node, uiKeyBinding_s::property, uiNode_s::root, UI_AllocStaticKeyBinding(), UI_ReadNodePath(), UI_WindowNodeRegisterKeyBinding(), and V_UI_NODEMETHOD.
Referenced by Key_Bind_f().
void UI_SetMouseCapture | ( | struct uiNode_s * | node | ) |
Captured the mouse into a node.
Definition at line 394 of file ui_input.c.
Referenced by UI_BarNodeMouseDown(), UI_BaseInventoryNodeMouseDown(), UI_ContainerNodeMouseDown(), UI_ControlsNodeMouseDown(), UI_EditorNodeStart(), UI_MapNodeMouseDown(), UI_ModelNodeMouseDown(), UI_RadarNodeMouseDown(), UI_SelectBoxNodeClick(), UI_SpinnerNodeDown(), UI_VScrollbarNodeAction(), and UI_ZoneNodeDown().