ui_node_keybinding.c File Reference

This node implements the key binding change and display. More...

#include "../ui_main.h"
#include "../ui_draw.h"
#include "../ui_nodes.h"
#include "../ui_font.h"
#include "../ui_parse.h"
#include "../ui_input.h"
#include "../ui_actions.h"
#include "../ui_render.h"
#include "ui_node_keybinding.h"
#include "ui_node_abstractnode.h"
#include "ui_node_panel.h"
#include "../../client.h"
Include dependency graph for ui_node_keybinding.c:

Go to the source code of this file.

Defines

#define TILE_SIZE   64
#define CORNER_SIZE   17
#define MID_SIZE   1
#define MARGE   3
#define EXTRADATA_TYPE   keyBindingExtraData_t
#define EXTRADATA(node)   UI_EXTRADATA(node, EXTRADATA_TYPE)

Functions

static void UI_KeyBindingNodeClick (uiNode_t *node, int x, int y)
 Called when the user click with the right mouse button.
static qboolean UI_KeyBindingNodeKeyPressed (uiNode_t *node, unsigned int key, unsigned short unicode)
 Called when we press a key when the node got the focus.
static void UI_KeyBindingNodeDraw (uiNode_t *node)
static void UI_KeyBindingNodeLoading (uiNode_t *node)
 Call before the script initialization of the node.
void UI_RegisterKeyBindingNode (uiBehaviour_t *behaviour)

Variables

static const value_t properties []

Detailed Description

This node implements the key binding change and display.

Definition in file ui_node_keybinding.c.


Define Documentation

#define CORNER_SIZE   17

Definition at line 41 of file ui_node_keybinding.c.

#define EXTRADATA ( node   )     UI_EXTRADATA(node, EXTRADATA_TYPE)

Definition at line 46 of file ui_node_keybinding.c.

#define EXTRADATA_TYPE   keyBindingExtraData_t

Definition at line 45 of file ui_node_keybinding.c.

#define MARGE   3

Definition at line 43 of file ui_node_keybinding.c.

#define MID_SIZE   1

Definition at line 42 of file ui_node_keybinding.c.

#define TILE_SIZE   64

Definition at line 40 of file ui_node_keybinding.c.


Function Documentation

static void UI_KeyBindingNodeClick ( uiNode_t node,
int  x,
int  y 
) [static]

Called when the user click with the right mouse button.

Definition at line 51 of file ui_node_keybinding.c.

References uiNode_s::disabled, uiNode_s::onClick, uiNode_s::text, UI_ExecuteEventActions(), UI_HasFocus(), and UI_RequestFocus().

Referenced by UI_RegisterKeyBindingNode().

static void UI_KeyBindingNodeDraw ( uiNode_t node  )  [static]
static qboolean UI_KeyBindingNodeKeyPressed ( uiNode_t node,
unsigned int  key,
unsigned short  unicode 
) [static]

Called when we press a key when the node got the focus.

Returns:
True, if we use the event

Todo:
what about macro expansion?
Todo:
ensure that the binding for the key command is not executed

Definition at line 74 of file ui_node_keybinding.c.

References _, binding, EXTRADATA, Key_GetBinding(), Key_KeynumToString(), Key_SetBinding(), uiNode_s::onChange, qfalse, qtrue, uiNode_s::text, UI_DisplayNotice(), UI_ExecuteEventActions(), UI_RemoveFocus(), and va().

Referenced by UI_RegisterKeyBindingNode().

static void UI_KeyBindingNodeLoading ( uiNode_t node  )  [static]

Call before the script initialization of the node.

Definition at line 180 of file ui_node_keybinding.c.

References ALIGN_CL, uiNode_s::color, EXTRADATA, uiNode_s::padding, uiNode_s::selectedColor, uiNode_s::textalign, and Vector4Set.

Referenced by UI_RegisterKeyBindingNode().

void UI_RegisterKeyBindingNode ( uiBehaviour_t behaviour  ) 

Variable Documentation

const value_t properties[] [static]
Initial value:
 {
    {"keyspace", V_INT, UI_EXTRADATA_OFFSETOF(keyBindingExtraData_t, keySpace), MEMBER_SIZEOF(keyBindingExtraData_t, keySpace)},
    {"bindingwidth", V_INT, UI_EXTRADATA_OFFSETOF(keyBindingExtraData_t, bindingWidth), MEMBER_SIZEOF(keyBindingExtraData_t, bindingWidth)},

    {NULL, V_NULL, 0, 0}
}

Definition at line 189 of file ui_node_keybinding.c.


Generated by  doxygen 1.6.2