Key handling problems



Hi all,

        I'm trying to check if a user press some keys. I want to check
If the user press control+j. I'm having problems with it. I paste my
code:

guint key = self->priv->key;
                
if ((event->state & self->priv->mod) == self->priv->mod &&
        event->keyval == key) 
{
        xxxxxxxxx
}

Currently this code do:

1.- If the user has NumLk enabled works fine
2.- If the user has lock caps enable it doesn't work because the j is
not j is J (upper)
3.- The control check works fine
4.- If I press contro+alt+j works (It may fail because I want to
check control+j not control+alt+j)
5.- If I press contro+shift+j doesn't work because the j is not J but
the state check sais true

I have tried 1000 ways to do it, I have see a lot of code but I have
not luck

Can you help me? I'm desperated :(

Regards,
        Perriman



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