-
Notifications
You must be signed in to change notification settings - Fork 6
InputSystem
This file is concerned only with the fe-text version of irssi (that is, the
standard tty client), and investigates the inner workings of the binding,
dispatch and key handling code.
Main files:
keyboardkeyboard.ckeyboard.hgui-readlinegui-readline.cgui-readline.h
Associated Signals:
- "
keyboard created" - "
keyboard destroyed" - "
key created" - "
key destroyed" - "
keyinfo created" - "
keyinfo destroyed" - "
key <keyname>"
Data Structures:
-
char *key_state; /* the ongoing key combo */
void *gui_data; /* GUI specific data sent in "key pressed" signal */ -
char *id;
char *description;
GSList*keys, *default_keys; -
KEYINFO_REC *info;
char *key;
char *data;
gui-readline is responsible for creating and owning the KEYBOARD_REC
instance. The keyboard instance is created in gui_readline_init(), setting
rec->gui_data to NULL. rec->key_state isn't initialised.
Only a single keyboard instance is ever created. The creation causes the
emission of a "keyboard created" signal, but this occurs before the perl
script interpreter is loaded, and hence cannot be used in scripts.
Once the keyboard object is created, is it populated with the default bindings,
still within the gui_readline_init() function. A simple lock-style
function-pair (key_configure_freeze(), key_configure_thaw()) allows the
manipulation of large numbers of key entries at once without running the costly
key_states_rescan() function each time.
void key_bind(const char *id, const char *description, const char *key_default, const char *data, SIGNAL_FUNC func)
is the entry-point for setting up both bindings, and the actions which bindings perform.
things.
Much of the content on these pages is taken from original Irssi documentation and is Copyright © 2000-2010 The Irssi project. Formatting and additional documentation, examples, etc by Tom Feist and the other editors of this wiki. This work is licensed under a Creative Commons Attribution-ShareAlike 2.5 License. Please see http://creativecommons.org/licenses/by-sa/2.5/ for details.