Re: [Vala] keybinding in vala



Thanks for answer! Some comments below.

23.04.2014 14:45, Gilzad Hamuni пишет:
 
public SomeCtor()
{
    textView.key_press_event.connect(OnKeyPressed);
}

Where should I plug this if I want ap-wide keybindings? For example I have a gtk app
with menu, couple of toolbars and status bar and gtk.notebook. Shall I call
.key_press_event.connect() for toolbar? notebook? something else?
 
 
bool OnKeyPressed(Widget source, Gdk.EventKey eventKey)
{
  if( ( (eventKey.state & Gdk.ModifierType.CONTROL_MASK) != 0) && (eventKey.hardware_keycode == 28) )

Where does 28 comes from? I'd like to avoid hardcoding if possible. Also, what about
i18n? Will it work with non-English keyboard layout?

cheers,
Max.



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