cwidget 0.5.18
keybindings.h File Reference

Support for defining and remapping keybindings. More...

#include <map>
#include <string>
#include <vector>
#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

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

Macros

#define KEY_CTRL(x)
 Attempt to compute the control character related to a terminal key.
 
#define KEY_ALT(x)
 

Typedefs

typedef std::vector< keycwidget::config::keybinding
 The type used to store the keybindings of a function.
 

Functions

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

Detailed Description

Support for defining and remapping keybindings.

Macro Definition Documentation

◆ KEY_ALT

#define KEY_ALT ( x)
Value:
key((0x200 | (x)), false)

◆ KEY_CTRL

#define KEY_CTRL ( x)
Value:
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().