Re: Catching the arrow keys



so is there a way to find out who that may be?

Assuming i know which widget is the culprit (I suspect it could be the
ScrolledWindow),
how could i make sure that it returns a "false" when it gets an arrow keys?

Jody

On Thu, Apr 22, 2010 at 5:36 PM, Oscar Lazzarino
<oscar lazzarino gmail com> wrote:
> Key events are propagated from childern up to parents, up to the first
> widget whose on_key_press_event returns "true"
>
> You probably have some widget in your window that manages arrows keys
> (i.e. returns "true") but does not manage the esc key (ie returns
> "false").
>
> On Thu, Apr 22, 2010 at 4:56 PM, jody <jody xha gmail com> wrote:
>> Interestingly, the function is not called at all when i press any of the keys
>> left, right, up, down, home, end, pgUp, pgDn
>>
>> Although Home, End, pgUp and pgDn do have an effect:
>> my window contains an Gtk::Image inside a Gtk::ScrolledWindow,
>> the latter key move the vertical scrollbar.
>>
>> So somehow those special keys get lost somewhere,
>> but all other keys (letters, Escape, Delete, Ins, all F-keys) work correctly.
>>
>>
>> On Thu, Apr 22, 2010 at 4:44 PM, Paul Davis <paul linuxaudiosystems com> wrote:
>>> On Thu, Apr 22, 2010 at 6:37 AM, jody <jody xha gmail com> wrote:
>>>
>>>> But when my Window is running, only the Escape key is caught, but none
>>>> of the arrow keys.
>>>> Am i missing something, or isn't it possible?
>>>
>>> also, the simple approach is to just add:
>>>
>>>    default:
>>>         printf ("Key pressed was: %d\n", ev->key);
>>>         break;
>>>
>>> to see what you do get.
>>>
>> _______________________________________________
>> gtkmm-list mailing list
>> gtkmm-list gnome org
>> http://mail.gnome.org/mailman/listinfo/gtkmm-list
>>
>


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