Dillo v3.2.0-88-g47ab7c70
Loading...
Searching...
No Matches
keys.hh
Go to the documentation of this file.
1/*
2 * Key parser
3 *
4 * Copyright (C) 2009 Jorge Arellano Cid <jcid@dillo.org>
5 * Copyright (C) 2024-2025 Rodrigo Arias Mallo <rodarima@gmail.com>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 3 of the License, or
10 * (at your option) any later version.
11 */
12
13#ifndef __KEYS_HH__
14#define __KEYS_HH__
15
16
67
68class Keys {
69private:
70 static int nodeByKeyCmp(const void *node, const void *key);
71 static void delKeyCmd(int key, int mod);
72 static KeysCommand_t getCmdCode(const char *symbolName);
73 static int getKeyCode(char *keyName);
74 static int getModifier(char *modifierName);
75 static void parseKey(char *key, char *symbol);
76 static const char *getKeyName(int key);
77public:
78 static void init();
79 static void free();
80 static void parse(FILE *fp);
81 static KeysCommand_t getKeyCmd(void);
82 static int getShortcut(KeysCommand_t cmd);
83 static void genAboutKeys(void);
84};
85
86
87#endif /* __KEYS_HH__ */
Definition keys.hh:68
static void parse(FILE *fp)
Parse the keysrc.
Definition keys.cc:412
static void init()
Initialize the bindings list.
Definition keys.cc:166
static KeysCommand_t getKeyCmd(void)
Look if the just pressed key is bound to a command.
Definition keys.cc:213
static KeysCommand_t getCmdCode(const char *symbolName)
Takes a command name and searches it in the mapping table.
Definition keys.cc:300
static int getShortcut(KeysCommand_t cmd)
Given a keys command, return a shortcut for it, or 0 if there is none (e.g., for KEYS_NEW_WINDOW,...
Definition keys.cc:331
static void free()
Free data.
Definition keys.cc:187
static void delKeyCmd(int key, int mod)
Remove a key binding from the table.
Definition keys.cc:245
static const char * getKeyName(int key)
Definition keys.cc:276
static void parseKey(char *key, char *symbol)
Parse a key-combination/command-name pair, and insert it into the bindings list.
Definition keys.cc:347
static void genAboutKeys(void)
Definition keys.cc:435
static int nodeByKeyCmp(const void *node, const void *key)
Compare function by {key,modifier} pairs.
Definition keys.cc:202
static int getModifier(char *modifierName)
Takes a modifier name and looks it up in the mapping table.
Definition keys.cc:315
static int getKeyCode(char *keyName)
Takes a key name and looks it up in the mapping table.
Definition keys.cc:264
KeysCommand_t
Definition keys.hh:17
@ KEYS_INVALID
Definition keys.hh:18
@ KEYS_COPY
Definition keys.hh:52
@ KEYS_SCREEN_RIGHT
Definition keys.hh:45
@ KEYS_BOTTOM
Definition keys.hh:51
@ KEYS_STOP
Definition keys.hh:32
@ KEYS_LEFT
Definition keys.hh:48
@ KEYS_FOCUS_TAB10
Definition keys.hh:65
@ KEYS_RELOAD
Definition keys.hh:31
@ KEYS_RIGHT
Definition keys.hh:49
@ KEYS_NOP
Definition keys.hh:19
@ KEYS_FOCUS_TAB9
Definition keys.hh:64
@ KEYS_LEFT_TAB
Definition keys.hh:23
@ KEYS_FOCUS_TAB7
Definition keys.hh:62
@ KEYS_RIGHT_TAB
Definition keys.hh:24
@ KEYS_BOOKMARKS
Definition keys.hh:30
@ KEYS_CLOSE_ALL
Definition keys.hh:36
@ KEYS_LAST_TAB
Definition keys.hh:27
@ KEYS_BACK
Definition keys.hh:37
@ KEYS_ZOOM_OUT
Definition keys.hh:54
@ KEYS_FOCUS_TAB8
Definition keys.hh:63
@ KEYS_LINE_UP
Definition keys.hh:46
@ KEYS_FOCUS_TAB5
Definition keys.hh:60
@ KEYS_WEBSEARCH
Definition keys.hh:29
@ KEYS_ZOOM_RESET
Definition keys.hh:55
@ KEYS_SCREEN_DOWN
Definition keys.hh:43
@ KEYS_GOTO
Definition keys.hh:39
@ KEYS_OPEN
Definition keys.hh:20
@ KEYS_FOCUS_TAB4
Definition keys.hh:59
@ KEYS_SAVE
Definition keys.hh:33
@ KEYS_FIND
Definition keys.hh:28
@ KEYS_FOCUS_TAB2
Definition keys.hh:57
@ KEYS_HIDE_PANELS
Definition keys.hh:34
@ KEYS_FILE_MENU
Definition keys.hh:35
@ KEYS_FORWARD
Definition keys.hh:38
@ KEYS_FOCUS_TAB3
Definition keys.hh:58
@ KEYS_TOP
Definition keys.hh:50
@ KEYS_FOCUS_TAB6
Definition keys.hh:61
@ KEYS_FIRST_TAB
Definition keys.hh:26
@ KEYS_VIEW_SOURCE
Definition keys.hh:41
@ KEYS_HOME
Definition keys.hh:40
@ KEYS_LINE_DOWN
Definition keys.hh:47
@ KEYS_NEW_WINDOW
Definition keys.hh:21
@ KEYS_FOCUS_TAB1
Definition keys.hh:56
@ KEYS_NEW_TAB
Definition keys.hh:22
@ KEYS_SCREEN_LEFT
Definition keys.hh:44
@ KEYS_SCREEN_UP
Definition keys.hh:42
@ KEYS_CLOSE_TAB
Definition keys.hh:25
@ KEYS_ZOOM_IN
Definition keys.hh:53