Make VTE interpret all keyboard shortcuts except for focus group
keybindings. Add enum values for keybinding groups. Make Notebook tabs keybindings group. Move Go to tags items into Tags keybindings group. Move navigation items into a new Other keybindings group. git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@2027 ea778897-0a13-0410-b9d1-a72fbfd435f5
This commit is contained in:
parent
8787314e74
commit
f1e323f158
@ -16,6 +16,13 @@
|
|||||||
Capitalize revert menu item.
|
Capitalize revert menu item.
|
||||||
* src/interface.c, src/callbacks.c, src/callbacks.h, geany.glade:
|
* src/interface.c, src/callbacks.c, src/callbacks.h, geany.glade:
|
||||||
Add 'Strip Trailing Spaces' document menu item.
|
Add 'Strip Trailing Spaces' document menu item.
|
||||||
|
* src/keybindings.c, src/keybindings.h, src/plugindata.h, TODO:
|
||||||
|
Make VTE interpret all keyboard shortcuts except for focus group
|
||||||
|
keybindings.
|
||||||
|
Add enum values for keybinding groups.
|
||||||
|
Make Notebook tabs keybindings group.
|
||||||
|
Move Go to tags items into Tags keybindings group.
|
||||||
|
Move navigation items into a new Other keybindings group.
|
||||||
|
|
||||||
|
|
||||||
2007-11-05 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
|
2007-11-05 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
|
||||||
|
2
TODO
2
TODO
@ -6,8 +6,6 @@ TODO List:
|
|||||||
o fix bug that prevents UTF-16, UTF-32 files from being loaded.
|
o fix bug that prevents UTF-16, UTF-32 files from being loaded.
|
||||||
o tagmanager fails on UTF-16/32
|
o tagmanager fails on UTF-16/32
|
||||||
o fix parsing command line args after given filenames
|
o fix parsing command line args after given filenames
|
||||||
o make the VTE interpret keybindings first (not just some bash
|
|
||||||
shortcuts).
|
|
||||||
|
|
||||||
Next version or later:
|
Next version or later:
|
||||||
|
|
||||||
|
@ -355,17 +355,19 @@ void keybindings_init(void)
|
|||||||
load_user_kb();
|
load_user_kb();
|
||||||
|
|
||||||
// set section name
|
// set section name
|
||||||
keys[GEANY_KEYS_MENU_NEW]->section = _("File menu");
|
keys[GEANY_KEYS_GROUP_FILE]->section = _("File menu");
|
||||||
keys[GEANY_KEYS_MENU_UNDO]->section = _("Edit menu");
|
keys[GEANY_KEYS_GROUP_EDIT]->section = _("Edit menu");
|
||||||
keys[GEANY_KEYS_MENU_FIND]->section = _("Search menu");
|
keys[GEANY_KEYS_GROUP_SEARCH]->section = _("Search menu");
|
||||||
keys[GEANY_KEYS_MENU_TOGGLEALL]->section = _("View menu");
|
keys[GEANY_KEYS_GROUP_VIEW]->section = _("View menu");
|
||||||
keys[GEANY_KEYS_MENU_REPLACETABS]->section = _("Document menu");
|
keys[GEANY_KEYS_GROUP_DOCUMENT]->section = _("Document menu");
|
||||||
keys[GEANY_KEYS_BUILD_COMPILE]->section = _("Build menu");
|
keys[GEANY_KEYS_GROUP_BUILD]->section = _("Build menu");
|
||||||
keys[GEANY_KEYS_MENU_OPENCOLORCHOOSER]->section = _("Tools menu");
|
keys[GEANY_KEYS_GROUP_TOOLS]->section = _("Tools menu");
|
||||||
keys[GEANY_KEYS_MENU_HELP]->section = _("Help menu");
|
keys[GEANY_KEYS_GROUP_HELP]->section = _("Help menu");
|
||||||
keys[GEANY_KEYS_SWITCH_EDITOR]->section = _("Focus commands");
|
keys[GEANY_KEYS_GROUP_FOCUS]->section = _("Focus commands");
|
||||||
keys[GEANY_KEYS_EDIT_TOGGLECASE]->section = _("Editing commands");
|
keys[GEANY_KEYS_GROUP_TABS]->section = _("Notebook tab commands");
|
||||||
keys[GEANY_KEYS_EDIT_AUTOCOMPLETE]->section = _("Tag commands");
|
keys[GEANY_KEYS_GROUP_EDITING]->section = _("Editing commands");
|
||||||
|
keys[GEANY_KEYS_GROUP_TAGS]->section = _("Tag commands");
|
||||||
|
keys[GEANY_KEYS_GROUP_OTHER]->section = _("Other commands");
|
||||||
|
|
||||||
add_menu_accels();
|
add_menu_accels();
|
||||||
}
|
}
|
||||||
@ -680,40 +682,22 @@ static gboolean set_sensitive(gpointer widget)
|
|||||||
#ifdef HAVE_VTE
|
#ifdef HAVE_VTE
|
||||||
static gboolean check_vte(GdkEventKey *event, guint keyval)
|
static gboolean check_vte(GdkEventKey *event, guint keyval)
|
||||||
{
|
{
|
||||||
|
guint i;
|
||||||
GtkWidget *widget;
|
GtkWidget *widget;
|
||||||
|
|
||||||
if (! vc->enable_bash_keys)
|
if (! vc->enable_bash_keys)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
if (gtk_window_get_focus(GTK_WINDOW(app->window)) != vc->vte)
|
if (gtk_window_get_focus(GTK_WINDOW(app->window)) != vc->vte)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
if (event->state == (GDK_CONTROL_MASK | GDK_SHIFT_MASK) &&
|
if (event->state == 0)
|
||||||
(keyval == GDK_c || keyval == GDK_v)) // copy/paste
|
return FALSE; // just to prevent menubar flickering
|
||||||
return TRUE;
|
|
||||||
if (event->state != GDK_CONTROL_MASK)
|
|
||||||
return FALSE;
|
|
||||||
|
|
||||||
// Check Ctrl-[a-z] terminal shortcuts
|
// make focus commands override any bash commands
|
||||||
switch (keyval)
|
for (i = GEANY_KEYS_GROUP_FOCUS; i < GEANY_KEYS_GROUP_TABS; i++)
|
||||||
{
|
{
|
||||||
case GDK_a:
|
if (event->state == keys[i]->mods && keyval == keys[i]->key)
|
||||||
case GDK_c:
|
|
||||||
case GDK_d:
|
|
||||||
case GDK_e:
|
|
||||||
case GDK_l:
|
|
||||||
case GDK_k:
|
|
||||||
case GDK_q:
|
|
||||||
case GDK_r:
|
|
||||||
case GDK_s:
|
|
||||||
case GDK_u:
|
|
||||||
case GDK_w:
|
|
||||||
case GDK_z:
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
if (event->state == keys[GEANY_KEYS_SWITCH_EDITOR]->mods &&
|
|
||||||
keyval == keys[GEANY_KEYS_SWITCH_EDITOR]->key)
|
|
||||||
return FALSE; // make switch to editor override any bash commands
|
|
||||||
|
|
||||||
/* Temporarily disable the menus to prevent conflicting menu accelerators
|
/* Temporarily disable the menus to prevent conflicting menu accelerators
|
||||||
* from overriding the VTE bash shortcuts.
|
* from overriding the VTE bash shortcuts.
|
||||||
|
@ -45,9 +45,11 @@ typedef struct binding
|
|||||||
} binding;
|
} binding;
|
||||||
|
|
||||||
|
|
||||||
|
// Plugin API
|
||||||
typedef enum
|
typedef enum
|
||||||
{
|
{
|
||||||
GEANY_KEYS_MENU_NEW = 0,
|
GEANY_KEYS_GROUP_FILE = 0,
|
||||||
|
GEANY_KEYS_MENU_NEW = GEANY_KEYS_GROUP_FILE,
|
||||||
GEANY_KEYS_MENU_OPEN,
|
GEANY_KEYS_MENU_OPEN,
|
||||||
GEANY_KEYS_MENU_OPENSELECTED,
|
GEANY_KEYS_MENU_OPENSELECTED,
|
||||||
GEANY_KEYS_MENU_SAVE,
|
GEANY_KEYS_MENU_SAVE,
|
||||||
@ -59,13 +61,15 @@ typedef enum
|
|||||||
GEANY_KEYS_MENU_RELOADFILE,
|
GEANY_KEYS_MENU_RELOADFILE,
|
||||||
GEANY_KEYS_MENU_PROJECTPROPERTIES,
|
GEANY_KEYS_MENU_PROJECTPROPERTIES,
|
||||||
|
|
||||||
GEANY_KEYS_MENU_UNDO,
|
GEANY_KEYS_GROUP_EDIT,
|
||||||
|
GEANY_KEYS_MENU_UNDO = GEANY_KEYS_GROUP_EDIT,
|
||||||
GEANY_KEYS_MENU_REDO,
|
GEANY_KEYS_MENU_REDO,
|
||||||
GEANY_KEYS_MENU_SELECTALL,
|
GEANY_KEYS_MENU_SELECTALL,
|
||||||
GEANY_KEYS_MENU_INSERTDATE,
|
GEANY_KEYS_MENU_INSERTDATE,
|
||||||
GEANY_KEYS_MENU_PREFERENCES,
|
GEANY_KEYS_MENU_PREFERENCES,
|
||||||
|
|
||||||
GEANY_KEYS_MENU_FIND,
|
GEANY_KEYS_GROUP_SEARCH,
|
||||||
|
GEANY_KEYS_MENU_FIND = GEANY_KEYS_GROUP_SEARCH,
|
||||||
GEANY_KEYS_MENU_FINDNEXT,
|
GEANY_KEYS_MENU_FINDNEXT,
|
||||||
GEANY_KEYS_MENU_FINDPREVIOUS,
|
GEANY_KEYS_MENU_FINDPREVIOUS,
|
||||||
GEANY_KEYS_MENU_FINDINFILES,
|
GEANY_KEYS_MENU_FINDINFILES,
|
||||||
@ -75,19 +79,22 @@ typedef enum
|
|||||||
GEANY_KEYS_MENU_NEXTMESSAGE,
|
GEANY_KEYS_MENU_NEXTMESSAGE,
|
||||||
GEANY_KEYS_MENU_GOTOLINE,
|
GEANY_KEYS_MENU_GOTOLINE,
|
||||||
|
|
||||||
GEANY_KEYS_MENU_TOGGLEALL,
|
GEANY_KEYS_GROUP_VIEW,
|
||||||
|
GEANY_KEYS_MENU_TOGGLEALL = GEANY_KEYS_GROUP_VIEW,
|
||||||
GEANY_KEYS_MENU_FULLSCREEN,
|
GEANY_KEYS_MENU_FULLSCREEN,
|
||||||
GEANY_KEYS_MENU_MESSAGEWINDOW,
|
GEANY_KEYS_MENU_MESSAGEWINDOW,
|
||||||
GEANY_KEYS_MENU_SIDEBAR,
|
GEANY_KEYS_MENU_SIDEBAR,
|
||||||
GEANY_KEYS_MENU_ZOOMIN,
|
GEANY_KEYS_MENU_ZOOMIN,
|
||||||
GEANY_KEYS_MENU_ZOOMOUT,
|
GEANY_KEYS_MENU_ZOOMOUT,
|
||||||
|
|
||||||
GEANY_KEYS_MENU_REPLACETABS,
|
GEANY_KEYS_GROUP_DOCUMENT,
|
||||||
|
GEANY_KEYS_MENU_REPLACETABS = GEANY_KEYS_GROUP_DOCUMENT,
|
||||||
GEANY_KEYS_MENU_FOLDALL,
|
GEANY_KEYS_MENU_FOLDALL,
|
||||||
GEANY_KEYS_MENU_UNFOLDALL,
|
GEANY_KEYS_MENU_UNFOLDALL,
|
||||||
GEANY_KEYS_RELOADTAGLIST,
|
GEANY_KEYS_RELOADTAGLIST,
|
||||||
|
|
||||||
GEANY_KEYS_BUILD_COMPILE,
|
GEANY_KEYS_GROUP_BUILD,
|
||||||
|
GEANY_KEYS_BUILD_COMPILE = GEANY_KEYS_GROUP_BUILD,
|
||||||
GEANY_KEYS_BUILD_LINK,
|
GEANY_KEYS_BUILD_LINK,
|
||||||
GEANY_KEYS_BUILD_MAKE,
|
GEANY_KEYS_BUILD_MAKE,
|
||||||
GEANY_KEYS_BUILD_MAKEOWNTARGET,
|
GEANY_KEYS_BUILD_MAKEOWNTARGET,
|
||||||
@ -97,24 +104,28 @@ typedef enum
|
|||||||
GEANY_KEYS_BUILD_RUN2,
|
GEANY_KEYS_BUILD_RUN2,
|
||||||
GEANY_KEYS_BUILD_OPTIONS,
|
GEANY_KEYS_BUILD_OPTIONS,
|
||||||
|
|
||||||
GEANY_KEYS_MENU_OPENCOLORCHOOSER,
|
GEANY_KEYS_GROUP_TOOLS,
|
||||||
|
GEANY_KEYS_MENU_OPENCOLORCHOOSER = GEANY_KEYS_GROUP_TOOLS,
|
||||||
GEANY_KEYS_MENU_INSERTSPECIALCHARS,
|
GEANY_KEYS_MENU_INSERTSPECIALCHARS,
|
||||||
|
|
||||||
GEANY_KEYS_MENU_HELP,
|
GEANY_KEYS_GROUP_HELP,
|
||||||
|
GEANY_KEYS_MENU_HELP = GEANY_KEYS_GROUP_HELP,
|
||||||
|
|
||||||
GEANY_KEYS_SWITCH_EDITOR,
|
GEANY_KEYS_GROUP_FOCUS,
|
||||||
|
GEANY_KEYS_SWITCH_EDITOR = GEANY_KEYS_GROUP_FOCUS,
|
||||||
GEANY_KEYS_SWITCH_SCRIBBLE,
|
GEANY_KEYS_SWITCH_SCRIBBLE,
|
||||||
GEANY_KEYS_SWITCH_VTE,
|
GEANY_KEYS_SWITCH_VTE,
|
||||||
GEANY_KEYS_SWITCH_SEARCH_BAR,
|
GEANY_KEYS_SWITCH_SEARCH_BAR,
|
||||||
GEANY_KEYS_SWITCH_TABLEFT,
|
|
||||||
|
GEANY_KEYS_GROUP_TABS,
|
||||||
|
GEANY_KEYS_SWITCH_TABLEFT = GEANY_KEYS_GROUP_TABS,
|
||||||
GEANY_KEYS_SWITCH_TABRIGHT,
|
GEANY_KEYS_SWITCH_TABRIGHT,
|
||||||
GEANY_KEYS_SWITCH_TABLASTUSED,
|
GEANY_KEYS_SWITCH_TABLASTUSED,
|
||||||
GEANY_KEYS_MOVE_TABLEFT,
|
GEANY_KEYS_MOVE_TABLEFT,
|
||||||
GEANY_KEYS_MOVE_TABRIGHT,
|
GEANY_KEYS_MOVE_TABRIGHT,
|
||||||
GEANY_KEYS_NAV_FORWARD,
|
|
||||||
GEANY_KEYS_NAV_BACK,
|
|
||||||
|
|
||||||
GEANY_KEYS_EDIT_TOGGLECASE,
|
GEANY_KEYS_GROUP_EDITING,
|
||||||
|
GEANY_KEYS_EDIT_TOGGLECASE = GEANY_KEYS_GROUP_EDITING,
|
||||||
GEANY_KEYS_EDIT_DUPLICATELINE,
|
GEANY_KEYS_EDIT_DUPLICATELINE,
|
||||||
GEANY_KEYS_EDIT_DELETELINE,
|
GEANY_KEYS_EDIT_DELETELINE,
|
||||||
GEANY_KEYS_EDIT_COPYLINE,
|
GEANY_KEYS_EDIT_COPYLINE,
|
||||||
@ -142,17 +153,21 @@ typedef enum
|
|||||||
GEANY_KEYS_EDIT_SCROLLLINEUP,
|
GEANY_KEYS_EDIT_SCROLLLINEUP,
|
||||||
GEANY_KEYS_EDIT_SCROLLLINEDOWN,
|
GEANY_KEYS_EDIT_SCROLLLINEDOWN,
|
||||||
GEANY_KEYS_EDIT_INSERTALTWHITESPACE,
|
GEANY_KEYS_EDIT_INSERTALTWHITESPACE,
|
||||||
|
|
||||||
GEANY_KEYS_POPUP_FINDUSAGE,
|
GEANY_KEYS_POPUP_FINDUSAGE,
|
||||||
GEANY_KEYS_POPUP_GOTOTAGDEFINITION,
|
|
||||||
GEANY_KEYS_POPUP_GOTOTAGDECLARATION,
|
|
||||||
GEANY_KEYS_POPUP_CONTEXTACTION,
|
GEANY_KEYS_POPUP_CONTEXTACTION,
|
||||||
|
|
||||||
GEANY_KEYS_EDIT_AUTOCOMPLETE,
|
GEANY_KEYS_GROUP_TAGS,
|
||||||
|
GEANY_KEYS_EDIT_AUTOCOMPLETE = GEANY_KEYS_GROUP_TAGS,
|
||||||
GEANY_KEYS_EDIT_CALLTIP,
|
GEANY_KEYS_EDIT_CALLTIP,
|
||||||
GEANY_KEYS_EDIT_MACROLIST,
|
GEANY_KEYS_EDIT_MACROLIST,
|
||||||
GEANY_KEYS_EDIT_COMPLETECONSTRUCT,
|
GEANY_KEYS_EDIT_COMPLETECONSTRUCT,
|
||||||
GEANY_KEYS_EDIT_SUPPRESSCOMPLETION,
|
GEANY_KEYS_EDIT_SUPPRESSCOMPLETION,
|
||||||
|
GEANY_KEYS_POPUP_GOTOTAGDEFINITION,
|
||||||
|
GEANY_KEYS_POPUP_GOTOTAGDECLARATION,
|
||||||
|
|
||||||
|
GEANY_KEYS_GROUP_OTHER,
|
||||||
|
GEANY_KEYS_NAV_FORWARD = GEANY_KEYS_GROUP_OTHER,
|
||||||
|
GEANY_KEYS_NAV_BACK,
|
||||||
GEANY_MAX_KEYS
|
GEANY_MAX_KEYS
|
||||||
}
|
}
|
||||||
GeanyKeyCommand;
|
GeanyKeyCommand;
|
||||||
|
@ -71,12 +71,12 @@
|
|||||||
|
|
||||||
/* The API version should be incremented whenever any plugin data types below are
|
/* The API version should be incremented whenever any plugin data types below are
|
||||||
* modified or appended to. */
|
* modified or appended to. */
|
||||||
static const gint api_version = 27;
|
static const gint api_version = 28;
|
||||||
|
|
||||||
/* The ABI version should be incremented whenever existing fields in the plugin
|
/* The ABI version should be incremented whenever existing fields in the plugin
|
||||||
* data types below have to be changed or reordered. It should stay the same if fields
|
* data types below have to be changed or reordered. It should stay the same if fields
|
||||||
* are only appended, as this doesn't affect existing fields. */
|
* are only appended, as this doesn't affect existing fields. */
|
||||||
static const gint abi_version = 13;
|
static const gint abi_version = 14;
|
||||||
|
|
||||||
/* This performs runtime checks that try to ensure:
|
/* This performs runtime checks that try to ensure:
|
||||||
* 1. Geany ABI data types are compatible with this plugin.
|
* 1. Geany ABI data types are compatible with this plugin.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user