ui_input.h File Reference

This graph shows which files directly or indirectly include this file:

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_sUI_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_tUI_GetKeyBindingByIndex (int index)
struct uiNode_sUI_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).

Detailed Description

Definition in file ui_input.h.


Define Documentation

#define UI_MAX_KEYBINDING   128

Definition at line 31 of file ui_input.h.

Referenced by UI_AllocStaticKeyBinding().


Typedef Documentation


Function Documentation

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.

Returns:
A node, else NULL if the mouse hover nothing

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]
qboolean UI_HasFocus ( const struct uiNode_s node  ) 
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.

Parameters:
[in] key key code, either K_ value or lowercase ascii
[in] unicode translated meaning of keypress in unicode
Returns:
qtrue, if we used the event
Todo:
think about what we should do when the mouse is captured

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.

See also:
UI_LeftClick
UI_RightClick
UI_MiddleClick
CL_ZoomInQuant
CL_ZoomOutQuant

Todo:
should be send this event when the mouse up (after a down on the same node)

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.

Todo:
we can remove that loop with an array allocation

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   ) 
void UI_MouseUp ( int  x,
int  y,
int  button 
)

Called when we are in UI mode and up a mouse button.

See also:
UI_LeftClick
UI_RightClick
UI_MiddleClick
CL_ZoomInQuant
CL_ZoomOutQuant

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.

Note:
The geoscape zooming code is here, too (also in
See also:
CL_ParseInput)
UI_LeftClick
UI_RightClick
UI_MiddleClick
CL_ZoomInQuant
CL_ZoomOutQuant

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   ) 
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 
)
Todo:

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  ) 

Generated by  doxygen 1.6.2