[gnomemm] Key Events



Hi!!

We are developing an application in gnome-mm.
The application needs to allow user to operate it using key combinations.
We are providing the user "CTRL" + Key combinations for various operations

*****Attached is the code snippet for the same**************

bool window::on_key_press(GdkEventKey* key)
{
    if (( key->keyval == GDK_E || key->keyval == GDK_e)
          && ( key->state == GDK_CONTROL_MASK ))
    {
        /* IF CTLR + e / CTLR + E perform required operation*/
    }
}
**************************************************

When we execute the above code, it works fine.
But when "Num Lock"  is ON, the above "if" condition fails.

We found that when the "Num Lock" is activated, the "key->state" is
incremented by a factor of 16. This increment is not consistent for all the
keys.
This is causing a problem for as we are not able to find if the Num Lock is
activated or not.
And If activated what is the key->state behaviour for various keys.

Is there some way to get the "key->state" irrespective of the Num Lock key
state ?

Hoping for a positive response!

thanks & regards
Deepak




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