THINg

Blitz3D Forums/Blitz3D Programming/THINg

	If KeyHit(29) And KeyHit(31)
		SaveScreenshot()
	EndIf


it's a function called from an include file

but the thing does make save oit to a folder when I used in another program and that wans't an incluse file it just ain't working it dosn't come up with anything in the debugger it just dosn't work!

OK I take it back it does work

IS htere any way I can see if ctrl and s are hit in the space of 1 second

uh... why don't you just do,

If Keyhit(*ctrl's scancode*) and Keyhit(*S's scancode*)
SaveScreenShot()
endif

?

thats what the code above is but you have to hit them at the exactly same time

try using keydown instead, see if that makes a difference.

something like this?

global CtrlTimer#
global SkeyTimer#

if keyhit(ctrl) CtrlTimer = 1
if CtrlTimer>0.01 CtrlTimer = CtrlTimer - .01; or a variable to simulate 1sec

if keyhit(key_s) SkeyTimer = 1
if CtrlTimer>0.01 SkeyTimer = SkeyTimer - .01

if CtrlTimer>0 and SkeyTimer>0
SaveScreenshot()
endif

This
if CtrlTimer>0 and SkeyTimer>0 
SaveScreenshot() 
endif
should read:
if CtrlTimer>0 and SkeyTimer>0 
SaveScreenshot()
CtrlTimer = 0
SkeyTimer = 0 
endif
or you will get a LOT of screenshots.

Why not simply:

If (KeyDown(29) Or KeyDown(157)) And KeyHit(31)
  SaveScreenshot()
EndIf


?

As you have to hit them at the exactly same time

no, not really. Keydown will report the key being pressed as long as it is pressed.