cwidget  0.5.17
Classes | Namespaces | Macros | Typedefs | Functions
keybindings.h File Reference

Support for defining and remapping keybindings. More...

#include <list>
#include <map>
#include <string>
#include <cwidget/curses++.h>

Go to the source code of this file.

Classes

struct  cwidget::config::key
 Represents a keystroke as seen by curses. More...
 
class  cwidget::config::keybindings
 Stores the keys bound to various functions. More...
 

Namespaces

 cwidget
 The namespace containing everything defined by cwidget.
 
 cwidget::config
 Routines that support parsing and interpreting user configuration.
 

Macros

#define KEY_CTRL(x)   key(((x)&~(64|32)), false)
 Attempt to compute the control character related to a terminal key. More...
 
#define KEY_ALT(x)   key((0x200 | (x)), false)
 

Typedefs

typedef std::vector< key > cwidget::config::keybinding
 The type used to store the keybindings of a function. More...
 

Functions

key cwidget::config::parse_key (std::wstring keystr)
 Parse a keystroke definition. More...
 
wstring cwidget::config::keyname (const key &k)
 Convert a keystroke to its string definition. More...
 
wstring cwidget::config::readable_keyname (const key &k)
 Convert a keystroke to a human-readable keyname. More...
 

Detailed Description

Support for defining and remapping keybindings.

Macro Definition Documentation

◆ KEY_CTRL

#define KEY_CTRL (   x)    key(((x)&~(64|32)), false)

Attempt to compute the control character related to a terminal key.

Parameters
xThe character to modify (for instance, 'A' to return 'Control-A').

Referenced by cwidget::toplevel::init(), and cwidget::config::keybindings::key_matches().