Angband
Macros | Enumerations | Functions
ui-keymap.h File Reference

Keymap handling. More...

Go to the source code of this file.

Macros

#define KEYMAP_ACTION_MAX   20
 Maximum number of keypresses a trigger can map to.

Enumerations

enum  { KEYMAP_MODE_ORIG = 0, KEYMAP_MODE_ROGUE, KEYMAP_MODE_MAX }
 Keymap modes. More...

Functions

struct keypresskeymap_find (int keymap, struct keypress kc)
 Given a keymap mode and a keypress, return any attached action.
void keymap_add (int keymap, struct keypress trigger, struct keypress *actions, bool user)
 Given a keymap mode, a trigger, and an action, store it in the keymap list.
bool keymap_remove (int keymap, struct keypress trigger)
 Given a keypress, remove any keymap that would trigger on that key.
void keymap_free (void)
 Free all keymaps.
void keymap_dump (ang_file *fff)
 Save keymaps to the specified file.

Detailed Description

Keymap handling.

Copyright (c) 2011 Andi Sidwell

This work is free software; you can redistribute it and/or modify it under the terms of either:

a) the GNU General Public License as published by the Free Software Foundation, version 2, or

b) the "Angband licence": This software may be copied and distributed for educational, research, and not for profit purposes provided that this copyright and statement are included in all such copies. Other copyrights may also apply.

Macro Definition Documentation

#define KEYMAP_ACTION_MAX   20

Maximum number of keypresses a trigger can map to.

Referenced by ui_keymap_create().

Enumeration Type Documentation

anonymous enum

Keymap modes.

Enumerator:
KEYMAP_MODE_ORIG 
KEYMAP_MODE_ROGUE 
KEYMAP_MODE_MAX 

Function Documentation

void keymap_add ( int  keymap,
struct keypress  trigger,
struct keypress actions,
bool  user 
)

Given a keymap mode, a trigger, and an action, store it in the keymap list.

References keymap::actions, keymap::key, keymap_make(), KEYMAP_MODE_MAX, keymap_remove(), mem_zalloc(), keymap::next, and keymap::user.

Referenced by parse_prefs_keymap_input(), and ui_keymap_create().

void keymap_dump ( ang_file fff)
struct keypress* keymap_find ( int  keymap,
struct keypress  kc 
)
read

Given a keymap mode and a keypress, return any attached action.

References keymap::actions, keypress::code, keymap::key, KEYMAP_MODE_MAX, keypress::mods, and keymap::next.

Referenced by target_dir_allow(), textui_get_command(), and ui_keymap_query().

void keymap_free ( void  )

Free all keymaps.

References keymap::actions, i, mem_free(), N_ELEMENTS, and keymap::next.

Referenced by textui_cleanup().

bool keymap_remove ( int  keymap,
struct keypress  trigger 
)

Given a keypress, remove any keymap that would trigger on that key.

Given a keypress, remove any keymap that would trigger on that key.

Return TRUE if one was removed.

References keymap::actions, keypress::code, FALSE, keymap::key, KEYMAP_MODE_MAX, mem_free(), keypress::mods, keymap::next, prev, and TRUE.

Referenced by keymap_add(), and ui_keymap_remove().