mirror of
https://github.com/gryf/wmaker.git
synced 2026-04-08 17:03:31 +02:00
This patch extends the existing keybindings to support multiple keys and add an optional "sticky chain" mode that lets a prefix remain active until users press a cancel key so users can enter the continuation key without re-pressing the prefix. The idea is to bring Emacs shortcuts keybinding to wmaker. Normal (existing and enhanced) mode: Prefix behaves like a one-shot release before the next key if any. For example: Mod1+h -> hide the active application, that is still working as usual. But if you want for example to have all your window management keys under the same leader key you can now do something like that: "Mod4+w h" which is pressing the Super key with w, releasing them and pressing h. You can assign that key sequence to an action. Sticky chain mode: Pressing a configured prefix enters a short-lived sticky state. Sticky state expires on timeout or when explicitly canceled (with KeychainCancelKey). For example, you can define: "Mod4+a x" -> run xterm "Mod4+a b f" -> run firefox "Mod4+a b c" -> run google chrome In sticky mode, "Mod4+a x x b f", then KeychainCancelKey or KeychainTimeoutDelay, will launch 2 xterm and firefox. New options for WindowMaker conf file: KeychainTimeoutDelay: timeout in milliseconds (can be set to 0) Default: 500 Example: KeychainTimeoutDelay = 500; KeychainCancelKey: explicit keybinding used to cancel an active sticky chain. If set to None the feature has no dedicated cancel key and the chain only ends by timeout or naturally if the keybind pressed is not defined. Default: None Example: KeychainCancelKey = Escape;
62 lines
2.4 KiB
C
62 lines
2.4 KiB
C
/*
|
|
* Window Maker window manager
|
|
*
|
|
* Copyright (c) 1997-2003 Alfredo K. Kojima
|
|
*
|
|
* This program is free software; you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License as published by
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
* (at your option) any later version.
|
|
*
|
|
* This program is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public License along
|
|
* with this program; if not, write to the Free Software Foundation, Inc.,
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
*/
|
|
|
|
#ifndef WMDEFAULTS_H_
|
|
#define WMDEFAULTS_H_
|
|
|
|
typedef struct WDDomain {
|
|
const char *domain_name;
|
|
WMPropList *dictionary;
|
|
const char *path;
|
|
time_t timestamp;
|
|
} WDDomain;
|
|
|
|
WDDomain * wDefaultsInitDomain(const char *domain, Bool requireDictionary);
|
|
|
|
void wDefaultsMergeGlobalMenus(WDDomain *menuDomain);
|
|
|
|
void wReadDefaults(WScreen *scr, WMPropList *new_dict);
|
|
void wReadKeybindings(WScreen *scr, WMPropList *dict);
|
|
void wDefaultUpdateIcons(WScreen *scr);
|
|
void wReadStaticDefaults(WMPropList *dict);
|
|
void wDefaultsCheckDomains(void *arg);
|
|
void wSaveDefaults(WScreen *scr);
|
|
void wDefaultFillAttributes(const char *instance, const char *class,
|
|
WWindowAttributes *attr, WWindowAttributes *mask,
|
|
Bool useGlobalDefault);
|
|
|
|
char *get_default_image_path(void);
|
|
RImage *get_default_image(WScreen *scr);
|
|
|
|
char *wDefaultGetIconFile(const char *instance, const char *class, Bool default_icon);
|
|
|
|
RImage *get_icon_image(WScreen *scr, const char *winstance, const char *wclass, int max_size);
|
|
char *get_icon_filename(const char *winstance, const char *wclass, const char *command,
|
|
Bool default_icon);
|
|
|
|
|
|
int wDefaultGetStartWorkspace(WScreen *scr, const char *instance, const char *class);
|
|
void wDefaultChangeIcon(const char *instance, const char* class, const char *file);
|
|
RImage *get_rimage_from_file(WScreen *scr, const char *file_name, int max_size);
|
|
|
|
void wDefaultPurgeInfo(const char *instance, const char *class);
|
|
void wKeyTreeRebuild(WScreen *scr); /* Rebuild the key-chain trie from the current key bindings */
|
|
#endif /* WMDEFAULTS_H_ */
|