provide a modify_other_keys config option. defaults to false
This commit is contained in:
parent
4416affc56
commit
d4f8e66568
3
config
3
config
|
@ -31,6 +31,9 @@ cursor_shape = block
|
||||||
# set size hints for the window
|
# set size hints for the window
|
||||||
#size_hints = false
|
#size_hints = false
|
||||||
|
|
||||||
|
# emit escape sequences for other keys modified by Control
|
||||||
|
#modify_other_keys = false
|
||||||
|
|
||||||
[colors]
|
[colors]
|
||||||
foreground = #dcdccc
|
foreground = #dcdccc
|
||||||
foreground_bold = #ffffff
|
foreground_bold = #ffffff
|
||||||
|
|
|
@ -88,7 +88,7 @@ struct hint_info {
|
||||||
struct config_info {
|
struct config_info {
|
||||||
hint_info hints;
|
hint_info hints;
|
||||||
char *browser;
|
char *browser;
|
||||||
gboolean dynamic_title, urgent_on_bell, clickable_url, size_hints;
|
gboolean dynamic_title, urgent_on_bell, clickable_url, size_hints, modify_other_keys;
|
||||||
int tag;
|
int tag;
|
||||||
char *config_file;
|
char *config_file;
|
||||||
};
|
};
|
||||||
|
@ -160,6 +160,7 @@ static const std::map<int, const char *> modify_table = {
|
||||||
};
|
};
|
||||||
|
|
||||||
static gboolean modify_key_feed(GdkEventKey *event, keybind_info *info) {
|
static gboolean modify_key_feed(GdkEventKey *event, keybind_info *info) {
|
||||||
|
if (info->config.modify_other_keys) {
|
||||||
unsigned int keyval = gdk_keyval_to_lower(event->keyval);
|
unsigned int keyval = gdk_keyval_to_lower(event->keyval);
|
||||||
auto entry = modify_table.find((int)keyval);
|
auto entry = modify_table.find((int)keyval);
|
||||||
|
|
||||||
|
@ -167,6 +168,7 @@ static gboolean modify_key_feed(GdkEventKey *event, keybind_info *info) {
|
||||||
vte_terminal_feed_child(info->vte, entry->second, -1);
|
vte_terminal_feed_child(info->vte, entry->second, -1);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1263,6 +1265,7 @@ static void set_config(GtkWindow *window, VteTerminal *vte, config_info *info,
|
||||||
info->urgent_on_bell = cfg_bool("urgent_on_bell", TRUE);
|
info->urgent_on_bell = cfg_bool("urgent_on_bell", TRUE);
|
||||||
info->clickable_url = cfg_bool("clickable_url", TRUE);
|
info->clickable_url = cfg_bool("clickable_url", TRUE);
|
||||||
info->size_hints = cfg_bool("size_hints", FALSE);
|
info->size_hints = cfg_bool("size_hints", FALSE);
|
||||||
|
info->modify_other_keys = cfg_bool("modify_other_keys", FALSE);
|
||||||
|
|
||||||
g_free(info->browser);
|
g_free(info->browser);
|
||||||
info->browser = nullptr;
|
info->browser = nullptr;
|
||||||
|
@ -1440,7 +1443,7 @@ int main(int argc, char **argv) {
|
||||||
nullptr},
|
nullptr},
|
||||||
{vi_mode::insert, 0, 0, 0, 0},
|
{vi_mode::insert, 0, 0, 0, 0},
|
||||||
{{nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, 0, 0, 0},
|
{{nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, 0, 0, 0},
|
||||||
nullptr, FALSE, FALSE, FALSE, FALSE, -1, config_file},
|
nullptr, FALSE, FALSE, FALSE, FALSE, FALSE, -1, config_file},
|
||||||
gtk_window_fullscreen
|
gtk_window_fullscreen
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue