Page 1 of 1

@Fred, ExamineKeyboard()

Posted: Tue Dec 09, 2003 5:49 pm
by Codemonger
Hi Fred I was hoping you could implement a personal favour for me :twisted:

I am building the base layer to my engine and I have binding commands to speed up game programming, so the programmer does not have to keep track of user events, he/she simply binds them to procedures like so, works great so far except:

Code: Select all

 Declare ExitLoop()
 

 Init3D(32, 800, 600, #CMG3D_FSAA | #CMG3D_Windowed)

 BindWindowEvent(#PB_EventCloseWindow, @ExitLoop())
 BindKey(#PB_Shortcut_Tab, @ExitLoop(), #CMG3D_Pushed)
 
Repeat 

  Flip()          
  CheckBindings()                                 
                   
Until Quit = 1 


 CleanUp()


 Procedure ExitLoop()
    Shared Quit 
    Quit = 1
 EndProcedure

I would like to give the option of the user to use internal PB commands, also because I am currently trying to get the direct input keyboard DIOBJECTDATAFORMAT & DIDATAFORMAT working as it is hard to find the constant of this and convert it to PB ...

Anyway, when I use ExamineKeyboard() I get an error message "OpenScreen or OpenWindowedScreen must be called before this" ... It would be great, if I could use the command without the OpenScreen or OpenWindowedScren being called first :D

In the meantime I'll just try to do a quick hack for testing purposes ...

Posted: Tue Dec 09, 2003 6:08 pm
by Fred
Actually it should work, just try to disable the debugger. It shouldn't be used tough..

Posted: Tue Dec 09, 2003 6:20 pm
by Codemonger
Yeah works perfectly with debugger disabled, Thanks Fred.

I'll use it in the meantime until I get Direct Input fully working. Is their any way for me to disable that one check in the debugger ? While I test.

Posted: Tue Dec 09, 2003 6:26 pm
by Codemonger
ah, don't worry Fred I just found a quick way around it .. Thanks.

Posted: Tue Dec 09, 2003 11:04 pm
by Fred
You can put the keyboard commands in a 'DisableDebugger' & 'EnableDebuger' block