After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 399057 - Implement GtkBindings
Implement GtkBindings
Status: RESOLVED WONTFIX
Product: vte
Classification: Core
Component: general
0.15.x
Other All
: Normal minor
: ---
Assigned To: VTE Maintainers
VTE Maintainers
: 172766 (view as bug list)
Depends on:
Blocks: 109024 118967 153265 172766 375652 399947 vte1.0
 
 
Reported: 2007-01-21 16:18 UTC by Chris Wilson
Modified: 2015-12-26 12:46 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
better patch (9.76 KB, patch)
2008-12-06 02:52 UTC, Brian Cameron
none Details | Review
[PATCH] Bug 399057 – Implement GtkBindings (7.91 KB, patch)
2009-02-01 22:48 UTC, Christian Persch
none Details | Review

Description Chris Wilson 2007-01-21 16:18:23 UTC
Instead of hardcoding the key->event mapping in vte_terminal_key_press() the preferred method is to use GtkBinding, which allows the configuration of hotkeys.
Comment 1 Chris Wilson 2007-01-25 01:41:34 UTC
There's even the start of a patch in bug 172766.
Comment 2 Behdad Esfahbod 2007-11-27 12:40:22 UTC
Got patch? ;)
Comment 3 Behdad Esfahbod 2007-11-28 13:10:22 UTC
*** Bug 172766 has been marked as a duplicate of this bug. ***
Comment 4 Calum Benson 2008-09-12 15:44:40 UTC
Ping?  More grumbles on the OpenSolaris forums at the moment about not being able to use PgUp and PgDn without Shift :)  (Which is what the original patch in #172766 was for...)
Comment 5 Christian Persch 2008-09-12 17:25:08 UTC
Bug 172766 has a patch that can serve as a starting point. Just needs someone interested in this take this and finish it.
Comment 6 Behdad Esfahbod 2008-11-29 08:30:40 UTC
Ehem, ping? :)
Comment 7 Brian Cameron 2008-12-06 02:52:26 UTC
Created attachment 124042 [details] [review]
better patch


This patch is based on the earlier patch in the original bug report.  I updated it so that it applies against the latest version of VTE.  I also made a few changes to the patch:

- Now I define a VteKeyType enumeration rather than using the GTK_SCROLL 
  enumerations.  Since VTE supports key sequences that a superset of scrolling,
  it seems better for VTE to use its own enumeration.

- I changed the vte_scroll_page function to vte_key_sequence,    
  scroll_page_signal to key_sequence_signal, the signal name to "key-sequence"
  instead of "scroll-page", etc.  Again because the VTE key sequences are not 
  just for scrolling.

- The new patch supports the 1-line up/down keybindings and the Add/Subtract
  keybindings in addition to the home/end/pg-up/pg-down keybindings that
  the old patch supported.

- I am still not supporting Backspace/Delete/Insert keys via bindings, simply 
  because it isn't really clear to me how to make this work.  Especially for 
  the Backspace/Delete keys which currently set the "normal" variable which 
  gets used later in the vte_terminal_key_press function.  I'm not sure if 
  these keys really need to be supported by keybindings.  So perhaps someone
  could advise about this?

This patch seems to work in my testing with the default keys.  However, I'm not 
sure how to actually configure these keys to use a different key.   How do I actually configure my system to use a different key if desired?  For example, if I want to use just "Home" instead of "Shift-Home"?

Thanks.
Comment 8 Christian Persch 2008-12-06 13:46:36 UTC
Keybindings can be customised from a gtkrc file; cf. the "Resource files" section in gtk's API docs.

Few initial comments:

+#define VTE_KEY_TYPE (vte_key_type ())
+GType vte_key_type (void);

This should be unnecessary since the type-builtins code will do that. (And this should be vte_key_get_type() to stay with the std. naming.) 

+	void (*key_sequence)(VteTerminal* terminal, VteKeyType type);
+
 	/* Padding for future expansion. */
 	void (*vte_reserved3)(void);

Needs to remove one padding slot. Or make this not have a slot in the class at all, and then one wouldn't even need the public enum above.

+	guint key_sequence_signal;

Unused, so can be removed. 

Comment 9 Christian Persch 2009-02-01 22:48:47 UTC
Created attachment 127727 [details] [review]
[PATCH] Bug 399057 – Implement GtkBindings

 src/marshal.list |    1 +
 src/vte.c        |  151 ++++++++++++++++++++++++++++++++++--------------------
 2 files changed, 96 insertions(+), 56 deletions(-)
Comment 10 Brian Cameron 2010-01-22 15:21:38 UTC
Can this go upstream?
Comment 11 Behdad Esfahbod 2010-01-25 19:43:49 UTC
ChPe, is this ready to be committed, or needs some updating?
Comment 12 Christian Persch 2010-01-25 19:59:32 UTC
I'm not sure it's safe to do this. The patch makes changes to what the vte_terminal_key_press() event handler function does with these keycodes. Bindings are handled in the  GTK_WIDGET_CLASS(vte_terminal_parent_class))->key_press_event() call, while currently these keycodes are handled after much further preprocessing only. Is it really ok to skip all of that?
Comment 13 Behdad Esfahbod 2010-01-25 20:22:50 UTC
Don't know.
Comment 14 Christian Persch 2015-12-26 12:46:24 UTC
Not going to happen; in fact I removed the already existing bindings. The problem is that they make it very hard to do the disabling/reassigning in gnome-terminal's UI, and they don't add much anyway.