[Vala] Keyboard input, e.keyval and accel_groups
- From: David Gomes <david elementaryos org>
- To: vala-list gnome org
- Subject: [Vala] Keyboard input, e.keyval and accel_groups
- Date: Thu, 13 Sep 2012 14:13:48 +0100
Hello there,
I'm working on Pantheon Terminal (lp:pantheon-terminal), and I'm running
into a rather odd Vala issue. I want to implement Ctrl-+ and Ctrl-- for
zooming in and out of the terminal.
this.key_press_event.connect ((e) => {
switch (e.keyval) {
case Gdk.Key.plus:
print("Plus signal!\n");
break;
}
return false;
});
I have that code on my Gtk.Window to listen to keyboard events on the
terminal window. On my build, it works just fine, I hit the Plus button and
the program is listening to it. However, other people (namely using German
keyboard and Portuguese keyboard) don't get the output "Plus signal!".
I also tried using an accel_group with the following actions:
{ "ZoomIn", Gtk.Stock.ZOOM_IN, N_("Zoom in"), "<Control>plus",
N_("Zoom in"), action_zoom_in_font },
{ "ZoomOut", Gtk.Stock.ZOOM_OUT, N_("Zoom out"),
"<Control>minus", N_("Zoom out"), action_zoom_out_font },
These work just fine for me, when I hit <Control>plus the
action_zoom_in_font is executed and the font is zoomed in on. However, it's
not working for some other people.
Any ideas on what can be causing this? I'm very sure they're building it
just fine from the correct branch, and I've tried many similar things.
Thank you in advance.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]