Keyboard Scanning

Blitz3D Forums/Blitz3D Programming/Keyboard Scanning

The Forum Archive is locked. These are the original blitzbasic.com forums, kept so their posts can still be read and searched. No new topics, replies or edits can be made here. To join the conversation, head over to the Blitz3D+ forums.

I am developing a Space Invaders Game in 'c', I've come across a stumbling block however, it seems you cannot call unblocking keyboard entry (within ANSI C - I've realised kbhit() doesn't work). To this end, I'm contemplating running a BMax or B3D executable in parallel with my C space invaders, potentially writing keyboard entry to a file from BMax/B3D realtime - and periodically attempting to access the same file from within my C executable to 'move' the players tank at the bottom.

This is my first attempt at interfacing BMax / B3D with a C executable, any help appreciated.

Any suggestions greatfully received -

Regards,

BlitzPlotter.

; KeyHit Example 

; Set up the timer 
current=MilliSecs() 
Print "Press ESC a bunch of times for five seconds..." 

; Wait 5 seconds 
While MilliSecs() < current+5000 
Wend 

; Print the results 
Print "Pressed ESC " + KeyHit(1) + " times." 


Is this what you're looking for?

Thanks 33, was looking for something like this. Have located some TCP client code in B3D that I'm going to attempt communicating with a server app encompassing my space invaders C exe. Cheers.