A long standing "problem" with gtkD has been the lack of a wrapped gdk/gdkkeysyms.h. (AFAIK).
It's a file which contains the keycode definions that you can use together with your int onKeyPress( GdkEventKey?* event, Widget widget) by adding it with addOnKeyPress(&onKeyPress);
Then you could have something like:
int onKeyPress( GdkEventKey* event, Widget widget)
{
if(event !is null)
{
switch( event.keyval )
{
default:
break;
case GDK_Escape:
GtkD.mainQuit();
break;
case GDK_Left:
break;
case GDK_a:
break;
//etc.
}
}
return true;
}
So. Those GDK_Escape keycodes are not currently defined anywhere in gtkD. Someone posted about this in the forums maybe...
The wrapper doesn't handle #define's. I don't know how to add this stuff to the wrapper or the APIlookups. gtkDgl uses htod.exe to do something, if I remember correctly. Maybe that same method could be used to get the #defines too. Or then adding support for the wrapper to parse .h files and find the #defines and structs too. Those aren't found in the documentation, which is currently used for wrapping...
Anyway. Here's a quick file I did with htod.exe that has all the keycodes from gdkkeysyms.h. It should be attached... Maybe someone can figure out a way to possibly put this in /wrap directory and copy it with the APIlookups file copy method to /gdk/Keysyms.d or /gdk/Keysymbols.d. And add it to subversion then... :)