What I did to the C code is super simple... I just added
static unsigned int getkeycode[2];
unsigned int *bbSystemGetKey=getkeycode;
to the declares...
In the select for WM_KEYDOWN and WM_SYSKEYDOWN I added
getkeycode[1] = wp;
In the select for WM_KEYUP and WM_SYSKEYUP I added
getkeycode[1] = 0;
That's it for System.Win32.c
Just like in Blitz3D and Blitz+, it doesn't handle shift, ctrl, etc, though it does return their keycodes when they are hit by themselves. It just doesn't handle multiple combinations. Anyway... The other changes...
In driver.bmx in the TSystemDriver I added...
Method GetKey( ) Abstract
In System.bmx I added...
Rem
bbdoc: Check for general key down state
returns: keycode of key pressed
End Rem
Function GetKey( )
If auto_poll PollSystem
Return Driver.GetKey( )
End Function
In System.Win32.bmx I added the following to the Extern block...
Global bbSystemGetKey:Int Ptr="bbSystemGetKey"
And I added this as well to System.win32.bmx
Method GetKey()
Return bbSystemGetKey[1]
End Method
Craptacular code I know (why I used a 2 position array I don't know but I didn't feel like going back and redoing it.) but it does work... If someone wants to take a look at that handleMsg() routine in System.Win32.c and break it out or whatever into their own public module, THAT would be the way to do it. I haven't had time to look into it myself yet but if we don't see one from BR soon I'll have a go at it. Just been quite some time since I've done much with C. :)
I was thinking... return an int containing the keycode in the rightmost 8 bits with the leftmost bits containing flags for the special keys like shift, ctrl, alt, etc.
Of course I haven't even GLANCED at the mac code yet, but I would have to believe it would be SOMEWHAT similar.
Kanati