No macro in gdkkeysyms.h seems to match the enter key.



Hi!


Short version:

On my first try on handling keypress events with gtkmm, I am stuck with a probably trivial problem: The GdkEventKey.keyval of hitting the enter key does not seem to match any of the *Enter* or *Return* macros in gdkkeysyms.h. GdkEventKey.keyval is supposed to be compared to the values in gdkkeysyms.h, right? What is the right macro for the enter key?

More details:

If in a callback method I do thus:

bool My_widget::my_callback(GdkEventKey* event)
{
    std::cout << event->keyval << std::endl;
    std::cout << GDK_KEY_Return << std::endl;
    std::cout << GDK_KEY_KP_Enter << std::endl;
    std::cout << GDK_KEY_ISO_Enter << std::endl;
    std::cout << GDK_KEY_3270_Enter << std::endl;
    std::cout << GDK_KEY_RockerEnter << std::endl;

    return false;
}

… it shows that event->keyval is not matched by any of the macros I tried. This is the output:
65515
65293
65421
65076
64798
269025061

Did I miss the right macro for the enter key? If so, what is it? Is there any documentation on the macros in gdkkeysyms.h, or do you have to guess which macro to use for which key by their names?

Carlos

Attachment: pgpXPpWdukSNS.pgp
Description: PGP signature



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