Re: Ctrl key, event state value, XIM vs IBus



On 3 June 2013 22:49, Rui Tiago Cação Matos <tiagomatos gmail com> wrote:
On 3 June 2013 20:37, Luc Pionchon <pionchon luc gmail com> wrote:
I have a program that connects to the key pressed event. I am getting
different event->state value for Ctrl, depending on the input method.
- XIM  gives 4
- IBus gives 33554436

The IBus gtk+ module uses bits 24 and 25 on the GdkEventKey.state mask
to mark events in order to prevent a loop that would otherwise happen
due to how it processes events.

is this how it is meant to be? How should I process it?

You should process it like any other mask, use bit-wise operations. i.e.

if (state & GDK_CONTROL_MASK) { /* Ctrl bit is set */ }


Oh. Thank You Rui!


Luc


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