2017-04-15 06:32:05 -04:00
|
|
|
/*
|
|
|
|
* rofi
|
|
|
|
*
|
|
|
|
* MIT/X11 License
|
2021-06-09 08:50:39 -04:00
|
|
|
* Copyright © 2013-2021 Qball Cow <qball@gmpclient.org>
|
2017-04-15 06:32:05 -04:00
|
|
|
*
|
|
|
|
* Permission is hereby granted, free of charge, to any person obtaining
|
|
|
|
* a copy of this software and associated documentation files (the
|
|
|
|
* "Software"), to deal in the Software without restriction, including
|
|
|
|
* without limitation the rights to use, copy, modify, merge, publish,
|
|
|
|
* distribute, sublicense, and/or sell copies of the Software, and to
|
|
|
|
* permit persons to whom the Software is furnished to do so, subject to
|
|
|
|
* the following conditions:
|
|
|
|
*
|
|
|
|
* The above copyright notice and this permission notice shall be
|
|
|
|
* included in all copies or substantial portions of the Software.
|
|
|
|
*
|
|
|
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
|
|
|
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
|
|
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
|
|
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
|
|
|
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
|
|
|
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
|
|
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2015-07-27 04:17:12 -04:00
|
|
|
#ifndef ROFI_KEYB_H
|
|
|
|
#define ROFI_KEYB_H
|
2015-04-30 15:47:32 -04:00
|
|
|
|
2017-05-27 20:18:09 -04:00
|
|
|
#include "nkutils-bindings.h"
|
|
|
|
|
2016-01-07 02:54:24 -05:00
|
|
|
/**
|
|
|
|
* @defgroup KEYB KeyboardBindings
|
|
|
|
*
|
|
|
|
* @{
|
|
|
|
*/
|
|
|
|
|
2018-06-12 06:31:34 -04:00
|
|
|
/**
|
|
|
|
* List of all scopes the mouse can interact on.
|
|
|
|
*/
|
2017-05-27 20:18:09 -04:00
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
SCOPE_GLOBAL,
|
|
|
|
SCOPE_MOUSE_LISTVIEW,
|
|
|
|
SCOPE_MOUSE_LISTVIEW_ELEMENT,
|
|
|
|
|
|
|
|
#define SCOPE_MIN_FIXED SCOPE_MOUSE_EDITBOX
|
|
|
|
SCOPE_MOUSE_EDITBOX,
|
|
|
|
SCOPE_MOUSE_SCROLLBAR,
|
2019-03-19 17:45:10 -04:00
|
|
|
SCOPE_MOUSE_MODE_SWITCHER,
|
|
|
|
#define SCOPE_MAX_FIXED SCOPE_MOUSE_MODE_SWITCHER
|
2017-05-27 20:18:09 -04:00
|
|
|
} BindingsScope;
|
|
|
|
|
2016-10-14 02:47:21 -04:00
|
|
|
/**
|
|
|
|
* List of all possible actions that can be triggered by a keybinding.
|
|
|
|
*/
|
2016-03-24 17:13:19 -04:00
|
|
|
typedef enum
|
2015-04-30 15:47:32 -04:00
|
|
|
{
|
2016-01-07 10:01:56 -05:00
|
|
|
/** Paste from primary clipboard */
|
2017-05-27 20:18:09 -04:00
|
|
|
PASTE_PRIMARY = 1,
|
2016-01-07 10:01:56 -05:00
|
|
|
/** Paste from secondary clipboard */
|
2015-04-30 15:47:32 -04:00
|
|
|
PASTE_SECONDARY,
|
2016-01-07 10:01:56 -05:00
|
|
|
/** Clear the entry box. */
|
2015-04-30 15:47:32 -04:00
|
|
|
CLEAR_LINE,
|
2016-01-07 10:01:56 -05:00
|
|
|
/** Move to front of text */
|
2015-04-30 15:47:32 -04:00
|
|
|
MOVE_FRONT,
|
2016-01-07 10:01:56 -05:00
|
|
|
/** Move to end of text */
|
2015-04-30 15:47:32 -04:00
|
|
|
MOVE_END,
|
2016-01-07 10:01:56 -05:00
|
|
|
/** Move on word back */
|
2015-04-30 16:46:51 -04:00
|
|
|
MOVE_WORD_BACK,
|
2016-01-07 10:01:56 -05:00
|
|
|
/** Move on word forward */
|
2015-04-30 16:46:51 -04:00
|
|
|
MOVE_WORD_FORWARD,
|
2016-01-07 10:01:56 -05:00
|
|
|
/** Move character back */
|
2015-05-02 05:53:27 -04:00
|
|
|
MOVE_CHAR_BACK,
|
2016-01-07 10:01:56 -05:00
|
|
|
/** Move character forward */
|
2015-05-02 05:53:27 -04:00
|
|
|
MOVE_CHAR_FORWARD,
|
2016-01-07 10:01:56 -05:00
|
|
|
/** Remove previous word */
|
2015-04-30 15:47:32 -04:00
|
|
|
REMOVE_WORD_BACK,
|
2016-01-07 10:01:56 -05:00
|
|
|
/** Remove next work */
|
2015-04-30 15:47:32 -04:00
|
|
|
REMOVE_WORD_FORWARD,
|
2016-01-07 10:01:56 -05:00
|
|
|
/** Remove next character */
|
2015-04-30 15:47:32 -04:00
|
|
|
REMOVE_CHAR_FORWARD,
|
2016-01-07 10:01:56 -05:00
|
|
|
/** Remove previous character */
|
2015-04-30 16:42:04 -04:00
|
|
|
REMOVE_CHAR_BACK,
|
2016-07-25 05:32:30 -04:00
|
|
|
/** Remove till EOL */
|
|
|
|
REMOVE_TO_EOL,
|
2016-07-27 02:10:55 -04:00
|
|
|
/** Remove till SOL */
|
|
|
|
REMOVE_TO_SOL,
|
2016-01-07 10:01:56 -05:00
|
|
|
/** Accept the current selected entry */
|
2015-05-01 02:16:52 -04:00
|
|
|
ACCEPT_ENTRY,
|
2016-06-19 12:02:49 -04:00
|
|
|
ACCEPT_ALT,
|
2015-05-01 02:16:52 -04:00
|
|
|
ACCEPT_CUSTOM,
|
2021-06-15 08:43:30 -04:00
|
|
|
ACCEPT_CUSTOM_ALT,
|
2015-05-02 05:53:27 -04:00
|
|
|
MODE_NEXT,
|
2021-06-01 07:14:45 -04:00
|
|
|
MODE_COMPLETE,
|
2015-05-02 05:53:27 -04:00
|
|
|
MODE_PREVIOUS,
|
|
|
|
TOGGLE_CASE_SENSITIVITY,
|
|
|
|
DELETE_ENTRY,
|
2015-09-02 06:29:28 -04:00
|
|
|
ROW_LEFT,
|
|
|
|
ROW_RIGHT,
|
|
|
|
ROW_UP,
|
|
|
|
ROW_DOWN,
|
|
|
|
ROW_TAB,
|
|
|
|
PAGE_PREV,
|
|
|
|
PAGE_NEXT,
|
|
|
|
ROW_FIRST,
|
|
|
|
ROW_LAST,
|
|
|
|
ROW_SELECT,
|
|
|
|
CANCEL,
|
2015-05-05 13:30:43 -04:00
|
|
|
CUSTOM_1,
|
|
|
|
CUSTOM_2,
|
|
|
|
CUSTOM_3,
|
|
|
|
CUSTOM_4,
|
|
|
|
CUSTOM_5,
|
|
|
|
CUSTOM_6,
|
|
|
|
CUSTOM_7,
|
|
|
|
CUSTOM_8,
|
|
|
|
CUSTOM_9,
|
2015-09-02 04:05:02 -04:00
|
|
|
CUSTOM_10,
|
|
|
|
CUSTOM_11,
|
|
|
|
CUSTOM_12,
|
|
|
|
CUSTOM_13,
|
|
|
|
CUSTOM_14,
|
|
|
|
CUSTOM_15,
|
|
|
|
CUSTOM_16,
|
|
|
|
CUSTOM_17,
|
|
|
|
CUSTOM_18,
|
|
|
|
CUSTOM_19,
|
2015-12-09 02:29:18 -05:00
|
|
|
SCREENSHOT,
|
2019-05-04 05:01:09 -04:00
|
|
|
CHANGE_ELLIPSIZE,
|
2015-12-13 05:50:59 -05:00
|
|
|
TOGGLE_SORT,
|
2017-01-10 01:41:37 -05:00
|
|
|
SELECT_ELEMENT_1,
|
|
|
|
SELECT_ELEMENT_2,
|
|
|
|
SELECT_ELEMENT_3,
|
|
|
|
SELECT_ELEMENT_4,
|
|
|
|
SELECT_ELEMENT_5,
|
|
|
|
SELECT_ELEMENT_6,
|
|
|
|
SELECT_ELEMENT_7,
|
|
|
|
SELECT_ELEMENT_8,
|
|
|
|
SELECT_ELEMENT_9,
|
|
|
|
SELECT_ELEMENT_10,
|
2015-04-30 15:47:32 -04:00
|
|
|
} KeyBindingAction;
|
|
|
|
|
2018-06-12 06:31:34 -04:00
|
|
|
/**
|
|
|
|
* Actions mouse can take on the ListView.
|
|
|
|
*/
|
2017-05-27 20:18:09 -04:00
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
SCROLL_LEFT = 1,
|
|
|
|
SCROLL_RIGHT,
|
|
|
|
SCROLL_DOWN,
|
|
|
|
SCROLL_UP,
|
|
|
|
} MouseBindingListviewAction;
|
|
|
|
|
2018-06-12 06:31:34 -04:00
|
|
|
/**
|
|
|
|
* Actions mouse can take on the ListView element.
|
|
|
|
*/
|
2017-05-27 20:18:09 -04:00
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
SELECT_HOVERED_ENTRY = 1,
|
|
|
|
ACCEPT_HOVERED_ENTRY,
|
|
|
|
ACCEPT_HOVERED_CUSTOM,
|
|
|
|
} MouseBindingListviewElementAction;
|
|
|
|
|
2018-06-12 06:31:34 -04:00
|
|
|
/**
|
|
|
|
* Default mouse actions.
|
|
|
|
*/
|
2017-05-27 20:18:09 -04:00
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
MOUSE_CLICK_DOWN = 1,
|
|
|
|
MOUSE_CLICK_UP,
|
|
|
|
MOUSE_DCLICK_DOWN,
|
|
|
|
MOUSE_DCLICK_UP,
|
|
|
|
} MouseBindingMouseDefaultAction;
|
|
|
|
|
2015-05-02 06:21:54 -04:00
|
|
|
/**
|
|
|
|
* Parse the keybindings.
|
|
|
|
* This should be called after the setting system is initialized.
|
|
|
|
*/
|
2017-05-27 20:18:09 -04:00
|
|
|
gboolean parse_keys_abe ( NkBindings *bindings );
|
2015-05-02 06:21:54 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Setup the keybindings
|
|
|
|
* This adds all the entries to the settings system.
|
|
|
|
*/
|
2015-04-30 15:47:32 -04:00
|
|
|
void setup_abe ( void );
|
|
|
|
|
2021-06-30 07:29:54 -04:00
|
|
|
/**
|
|
|
|
* @param name Don't have the name.
|
|
|
|
*
|
|
|
|
* @returns id, or UINT32_MAX if not found.
|
|
|
|
*/
|
|
|
|
guint key_binding_get_action_from_name ( const char *name );
|
2020-10-12 15:39:36 -04:00
|
|
|
/**@}*/
|
2015-07-27 04:17:12 -04:00
|
|
|
#endif // ROFI_KEYB_H
|