Is there a way to bind "key-press-event" in gtkrc file?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi all,

I'm now trying to add some keybindings in GTK Emacs key theme.

One keybinding I want is [Ctrl + m] as [Enter] key. So I added the
code listed below to the gtkrc file.

  <code>
  bind "<ctrl>m" { "insert-at-cursor" ("\n") }
  </code>

As a result, this works well on the textview but not works on the gtkentry.
The behavior I expected to it is,

  1. press[Ctrl + m] on the gtkentry
  2. program behaves as if Enter key was pressed (e.g. start
searching, complete input, ...)

But actual behavior is just

  2. White cube [000A] (ascii newline code) inserted after the cursor position

So I searched a bit and found "key-press-event" signal on the next URL.

http://library.gnome.org/devel/gtk/unstable/GtkWidget.html#GtkWidget-key-press-event

This signal requires GdkEventKey as the second argument. So the bind
probably becomes like the code below.

  <code>
  bind "<ctrl>m" { "key-press-event (GdkEventKey) }
  </code>

I'm guessing how to give that GdkEventKey argument in the gtkrc file.

Could anyone give me some help?
_______________________________________________
gtk-list mailing list
gtk-list@xxxxxxxxx
http://mail.gnome.org/mailman/listinfo/gtk-list

[Index of Archives]     [Touch Screen Library]     [GIMP Users]     [Gnome]     [KDE]     [Yosemite News]     [Steve's Art]

  Powered by Linux