1
0
mirror of https://github.com/gryf/wmaker.git synced 2026-03-19 17:23:33 +01:00
Files
wmaker/src/keybind.h
David Maciejak ab45c6c6c2 Add central position feature for active window
This patch adds a new Central feature under the window menu
"Other maximization" entry.
Shortcut can be configured via WPrefs "Center active window" action.
When called the active window is centered on the screen head.
If the window height or width are bigger than the head size,
the window is resized to fit.
There are some transitions defined as below:
*from fullscreen to center
*from any corner to center
*from top half to center top half
*from bottom half to center bottom half
*from left half to center left half
*from right half to center right half

Undoing the action is done via the window menu "Unmaximize" entry
or the shortcut.
2023-03-31 09:11:38 +01:00

182 lines
3.5 KiB
C

/*
* Window Maker window manager
*
* Copyright (c) 1997-2003 Alfredo K. Kojima
* Copyright (c) 2014-2023 Window Maker Team
*
* 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 WMKEYBIND_H
#define WMKEYBIND_H
/* <X11/X.h> doesn't define these, even though XFree supports them */
#ifndef Button6
#define Button6 6
#endif
#ifndef Button7
#define Button7 7
#endif
#ifndef Button8
#define Button8 8
#endif
#ifndef Button9
#define Button9 9
#endif
enum {
/* anywhere */
WKBD_ROOTMENU,
WKBD_WINDOWMENU,
WKBD_WINDOWLIST,
/* window */
WKBD_MINIATURIZE,
WKBD_MINIMIZEALL,
WKBD_HIDE,
WKBD_HIDE_OTHERS,
WKBD_MAXIMIZE,
WKBD_VMAXIMIZE,
WKBD_HMAXIMIZE,
WKBD_LHMAXIMIZE,
WKBD_RHMAXIMIZE,
WKBD_THMAXIMIZE,
WKBD_BHMAXIMIZE,
WKBD_LTCMAXIMIZE,
WKBD_RTCMAXIMIZE,
WKBD_LBCMAXIMIZE,
WKBD_RBCMAXIMIZE,
WKBD_MAXIMUS,
WKBD_SELECT,
WKBD_KEEP_ON_TOP,
WKBD_KEEP_AT_BOTTOM,
WKBD_OMNIPRESENT,
WKBD_RAISE,
WKBD_LOWER,
WKBD_RAISELOWER,
WKBD_MOVERESIZE,
WKBD_SHADE,
WKBD_WORKSPACEMAP,
WKBD_FOCUSNEXT,
WKBD_FOCUSPREV,
WKBD_GROUPNEXT,
WKBD_GROUPPREV,
WKBD_CENTRAL,
/* window, menu */
WKBD_CLOSE,
/* Dock */
WKBD_DOCKRAISELOWER,
/* Clip */
WKBD_CLIPRAISELOWER,
/* workspace */
WKBD_WORKSPACE1,
WKBD_WORKSPACE2,
WKBD_WORKSPACE3,
WKBD_WORKSPACE4,
WKBD_WORKSPACE5,
WKBD_WORKSPACE6,
WKBD_WORKSPACE7,
WKBD_WORKSPACE8,
WKBD_WORKSPACE9,
WKBD_WORKSPACE10,
WKBD_NEXTWORKSPACE,
WKBD_PREVWORKSPACE,
WKBD_LASTWORKSPACE,
WKBD_NEXTWSLAYER,
WKBD_PREVWSLAYER,
/* move to workspace */
WKBD_MOVE_WORKSPACE1,
WKBD_MOVE_WORKSPACE2,
WKBD_MOVE_WORKSPACE3,
WKBD_MOVE_WORKSPACE4,
WKBD_MOVE_WORKSPACE5,
WKBD_MOVE_WORKSPACE6,
WKBD_MOVE_WORKSPACE7,
WKBD_MOVE_WORKSPACE8,
WKBD_MOVE_WORKSPACE9,
WKBD_MOVE_WORKSPACE10,
WKBD_MOVE_NEXTWORKSPACE,
WKBD_MOVE_PREVWORKSPACE,
WKBD_MOVE_LASTWORKSPACE,
WKBD_MOVE_NEXTWSLAYER,
WKBD_MOVE_PREVWSLAYER,
/* window shortcuts */
WKBD_WINDOW1,
WKBD_WINDOW2,
WKBD_WINDOW3,
WKBD_WINDOW4,
WKBD_WINDOW5,
WKBD_WINDOW6,
WKBD_WINDOW7,
WKBD_WINDOW8,
WKBD_WINDOW9,
WKBD_WINDOW10,
/* shortcuts to move window between heads */
WKBD_MOVE_12_TO_6_HEAD,
WKBD_MOVE_6_TO_12_HEAD,
/* launch a new instance of the active window */
WKBD_RELAUNCH,
/* screen */
WKBD_SWITCH_SCREEN,
/* open "run" dialog */
WKBD_RUN,
/* open "exit" dialog */
WKBD_EXIT,
/* screen print */
WKBD_PRINTS,
/* window print */
WKBD_PRINTW,
/* partial print */
WKBD_PRINTP,
#ifdef KEEP_XKB_LOCK_STATUS
WKBD_TOGGLE,
#endif
/* keep this last */
WKBD_LAST
};
typedef struct WShortKey {
unsigned int modifier;
KeyCode keycode;
} WShortKey;
/* ---[ Global Variables ]------------------------------------------------ */
extern WShortKey wKeyBindings[WKBD_LAST];
/* ---[ Functions ]------------------------------------------------------- */
void wKeyboardInitialize(void);
#endif /* WMKEYBIND_H */