JWM Source Documentation
Macros | Typedefs | Functions | Variables
key.h File Reference

Header for the key binding functions. More...

Go to the source code of this file.

Macros

#define KEY_NONE   0
 
#define KEY_UP   1
 
#define KEY_DOWN   2
 
#define KEY_RIGHT   3
 
#define KEY_LEFT   4
 
#define KEY_ESC   5
 
#define KEY_ENTER   6
 
#define KEY_NEXT   7
 
#define KEY_NEXTSTACK   8
 
#define KEY_PREV   9
 
#define KEY_PREVSTACK   10
 
#define KEY_CLOSE   11
 
#define KEY_MIN   12
 
#define KEY_MAX   13
 
#define KEY_SHADE   14
 
#define KEY_STICK   15
 
#define KEY_MOVE   16
 
#define KEY_RESIZE   17
 
#define KEY_ROOT   18
 
#define KEY_WIN   19
 
#define KEY_DESKTOP   20
 
#define KEY_RDESKTOP   21
 
#define KEY_LDESKTOP   22
 
#define KEY_UDESKTOP   23
 
#define KEY_DDESKTOP   24
 
#define KEY_SHOWDESK   25
 
#define KEY_SHOWTRAY   26
 
#define KEY_EXEC   27
 
#define KEY_RESTART   28
 
#define KEY_EXIT   29
 
#define KEY_FULLSCREEN   30
 
#define KEY_SENDR   31
 
#define KEY_SENDL   32
 
#define KEY_SENDU   33
 
#define KEY_SENDD   34
 
#define KEY_MAXTOP   35
 
#define KEY_MAXBOTTOM   36
 
#define KEY_MAXLEFT   37
 
#define KEY_MAXRIGHT   38
 
#define KEY_MAXV   39
 
#define KEY_MAXH   40
 
#define KEY_RESTORE   41
 

Typedefs

typedef unsigned short KeyType
 Enumeration of key binding types.
 

Functions

void InitializeKeys (void)
 Initialize key data.
 
void StartupKeys (void)
 Startup key bindings.
 
void ShutdownKeys (void)
 Shutdown key bindings.
 
void DestroyKeys (void)
 Destroy key data.
 
KeyType GetKey (const XKeyEvent *event)
 Get the action to take from a key event.
 
unsigned int ParseModifierString (const char *str)
 Parse a modifier string.
 
void InsertBinding (KeyType key, const char *modifiers, const char *stroke, const char *code, const char *command)
 Insert a key binding.
 
void RunKeyCommand (const XKeyEvent *event)
 Run a command caused by a key binding.
 
void ShowKeyMenu (const XKeyEvent *event)
 Show a root menu caused by a key binding.
 
void ValidateKeys (void)
 Validate key bindings.
 

Variables

unsigned int lockMask
 Mask of 'lock' keys.
 

Detailed Description

Header for the key binding functions.

Author
Joe Wingbermuehle
Date
2004-2006

Definition in file key.h.

Macro Definition Documentation

#define KEY_CLOSE   11

Definition at line 29 of file key.h.

Referenced by HandleKeyPress(), and ShouldGrab().

#define KEY_DDESKTOP   24

Definition at line 42 of file key.h.

Referenced by HandleKeyPress(), and ShouldGrab().

#define KEY_DESKTOP   20

Definition at line 38 of file key.h.

Referenced by HandleKeyPress(), and ShouldGrab().

#define KEY_DOWN   2

Definition at line 20 of file key.h.

Referenced by MoveClientKeyboard(), ResizeClientKeyboard(), and UpdateMotion().

#define KEY_ENTER   6

Definition at line 24 of file key.h.

Referenced by HandleDialogKeyPress(), and UpdateMotion().

#define KEY_ESC   5

Definition at line 23 of file key.h.

Referenced by HandleDialogKeyPress(), and UpdateMotion().

#define KEY_EXEC   27

Definition at line 45 of file key.h.

Referenced by HandleKeyPress(), ParseKey(), and ShouldGrab().

#define KEY_EXIT   29

Definition at line 47 of file key.h.

Referenced by HandleKeyPress(), and ShouldGrab().

#define KEY_FULLSCREEN   30

Definition at line 48 of file key.h.

Referenced by HandleKeyPress(), and ShouldGrab().

#define KEY_LDESKTOP   22

Definition at line 40 of file key.h.

Referenced by HandleKeyPress(), and ShouldGrab().

#define KEY_LEFT   4

Definition at line 22 of file key.h.

Referenced by MoveClientKeyboard(), ResizeClientKeyboard(), and UpdateMotion().

#define KEY_MAX   13

Definition at line 31 of file key.h.

Referenced by HandleKeyPress(), and ShouldGrab().

#define KEY_MAXBOTTOM   36

Definition at line 54 of file key.h.

Referenced by HandleKeyPress(), and ShouldGrab().

#define KEY_MAXH   40

Definition at line 58 of file key.h.

Referenced by HandleKeyPress(), and ShouldGrab().

#define KEY_MAXLEFT   37

Definition at line 55 of file key.h.

Referenced by HandleKeyPress(), and ShouldGrab().

#define KEY_MAXRIGHT   38

Definition at line 56 of file key.h.

Referenced by HandleKeyPress(), and ShouldGrab().

#define KEY_MAXTOP   35

Definition at line 53 of file key.h.

Referenced by HandleKeyPress(), and ShouldGrab().

#define KEY_MAXV   39

Definition at line 57 of file key.h.

Referenced by HandleKeyPress(), and ShouldGrab().

#define KEY_MIN   12

Definition at line 30 of file key.h.

Referenced by HandleKeyPress(), and ShouldGrab().

#define KEY_MOVE   16

Definition at line 34 of file key.h.

Referenced by HandleKeyPress(), and ShouldGrab().

#define KEY_NEXT   7

Definition at line 25 of file key.h.

Referenced by HandleKeyPress(), HandleKeyRelease(), and ShouldGrab().

#define KEY_NEXTSTACK   8

Definition at line 26 of file key.h.

Referenced by HandleKeyPress(), HandleKeyRelease(), and ShouldGrab().

#define KEY_NONE   0

Definition at line 18 of file key.h.

Referenced by GetKey(), and ParseKey().

#define KEY_PREV   9

Definition at line 27 of file key.h.

Referenced by HandleKeyPress(), HandleKeyRelease(), and ShouldGrab().

#define KEY_PREVSTACK   10

Definition at line 28 of file key.h.

Referenced by HandleKeyPress(), HandleKeyRelease(), and ShouldGrab().

#define KEY_RDESKTOP   21

Definition at line 39 of file key.h.

Referenced by HandleKeyPress(), and ShouldGrab().

#define KEY_RESIZE   17

Definition at line 35 of file key.h.

Referenced by HandleKeyPress(), and ShouldGrab().

#define KEY_RESTART   28

Definition at line 46 of file key.h.

Referenced by HandleKeyPress(), and ShouldGrab().

#define KEY_RESTORE   41

Definition at line 59 of file key.h.

Referenced by HandleKeyPress(), and ShouldGrab().

#define KEY_RIGHT   3

Definition at line 21 of file key.h.

Referenced by MoveClientKeyboard(), ResizeClientKeyboard(), and UpdateMotion().

#define KEY_ROOT   18

Definition at line 36 of file key.h.

Referenced by HandleKeyPress(), ParseKey(), ShouldGrab(), and ValidateKeys().

#define KEY_SENDD   34

Definition at line 52 of file key.h.

Referenced by HandleKeyPress(), and ShouldGrab().

#define KEY_SENDL   32

Definition at line 50 of file key.h.

Referenced by HandleKeyPress(), and ShouldGrab().

#define KEY_SENDR   31

Definition at line 49 of file key.h.

Referenced by HandleKeyPress(), and ShouldGrab().

#define KEY_SENDU   33

Definition at line 51 of file key.h.

Referenced by HandleKeyPress(), and ShouldGrab().

#define KEY_SHADE   14

Definition at line 32 of file key.h.

Referenced by HandleKeyPress(), and ShouldGrab().

#define KEY_SHOWDESK   25

Definition at line 43 of file key.h.

Referenced by HandleKeyPress(), and ShouldGrab().

#define KEY_SHOWTRAY   26

Definition at line 44 of file key.h.

Referenced by HandleKeyPress(), and ShouldGrab().

#define KEY_STICK   15

Definition at line 33 of file key.h.

Referenced by HandleKeyPress(), and ShouldGrab().

#define KEY_UDESKTOP   23

Definition at line 41 of file key.h.

Referenced by HandleKeyPress(), and ShouldGrab().

#define KEY_UP   1

Definition at line 19 of file key.h.

Referenced by MoveClientKeyboard(), ResizeClientKeyboard(), and UpdateMotion().

#define KEY_WIN   19

Definition at line 37 of file key.h.

Referenced by HandleKeyPress(), and ShouldGrab().

Typedef Documentation

typedef unsigned short KeyType

Enumeration of key binding types.

Note that we use the high bits to store additional information for some key types (for example the desktop number).

Definition at line 17 of file key.h.

Function Documentation

void DestroyKeys ( void  )

Destroy key data.

Definition at line 157 of file key.c.

References KeyNode::command, KeyNode::next, and Release.

Referenced by Destroy().

KeyType GetKey ( const XKeyEvent *  event)

Get the action to take from a key event.

Parameters
eventThe event.

Definition at line 204 of file key.c.

References KeyNode::code, KeyNode::key, KEY_NONE, lockMask, KeyNode::next, and KeyNode::state.

Referenced by HandleDialogKeyPress(), HandleKeyPress(), HandleKeyRelease(), MoveClientKeyboard(), ResizeClientKeyboard(), and UpdateMotion().

void InitializeKeys ( void  )

Initialize key data.

Definition at line 83 of file key.c.

References lockMask.

Referenced by Initialize().

void InsertBinding ( KeyType  key,
const char *  modifiers,
const char *  stroke,
const char *  code,
const char *  command 
)

Insert a key binding.

Parameters
keyThe key binding type.
modifiersThe modifier mask.
strokeThe key stroke (not needed if code given).
codeThe key code (not needed if stroke given).
commandExtra parameter needed for some key binding types.

Definition at line 377 of file key.c.

References _, Allocate, bindings, KeyNode::code, KeyNode::command, CopyString(), KeyNode::key, KeyNode::next, ParseKeyString(), ParseModifierString(), Release, KeyNode::state, KeyNode::symbol, and Warning().

Referenced by ParseKey().

unsigned int ParseModifierString ( const char *  str)

Parse a modifier string.

Parameters
strThe modifier string.
Returns
The modifier mask.

Definition at line 333 of file key.c.

References _, JUNLIKELY, ModifierNode::mask, MASK_NONE, ModifierNode::name, and Warning().

Referenced by InsertBinding(), and ParseMoveMode().

void RunKeyCommand ( const XKeyEvent *  event)

Run a command caused by a key binding.

Parameters
eventThe event causing the command to be run.

Definition at line 225 of file key.c.

References KeyNode::code, KeyNode::command, lockMask, KeyNode::next, RunCommand(), and KeyNode::state.

Referenced by HandleKeyPress().

void ShowKeyMenu ( const XKeyEvent *  event)

Show a root menu caused by a key binding.

Parameters
eventThe event that caused the menu to be shown.

Definition at line 244 of file key.c.

References KeyNode::code, KeyNode::command, GetRootMenuIndexFromString(), JLIKELY, lockMask, KeyNode::next, ShowRootMenu(), and KeyNode::state.

Referenced by HandleKeyPress().

void ShutdownKeys ( void  )

Shutdown key bindings.

Definition at line 132 of file key.c.

References display, GetTrays(), JXUngrabKey, LAYER_COUNT, TrayType::next, ClientNode::next, nodes, rootWindow, ClientNode::window, and TrayType::window.

Referenced by Shutdown().

void StartupKeys ( void  )
void ValidateKeys ( void  )

Validate key bindings.

This will log an error if an invalid key binding is found. This is called after parsing the configuration file.

Definition at line 460 of file key.c.

References _, KeyNode::command, GetRootMenuIndexFromString(), IsRootMenuDefined(), JUNLIKELY, KeyNode::key, KEY_ROOT, KeyNode::next, and Warning().

Referenced by ParseConfig().

Variable Documentation

unsigned int lockMask

Mask of 'lock' keys.

Definition at line 75 of file key.c.

Referenced by GetKey(), HandleButtonEvent(), InitializeKeys(), RunKeyCommand(), ShowKeyMenu(), and StartupKeys().

joewing.net / Projects / JWM