THINg

Blitz3D Forums/Blitz3D Programming/THINg

Agamer(Posted 2003) [#1]
	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!


Agamer(Posted 2003) [#2]
OK I take it back it does work


Agamer(Posted 2003) [#3]
IS htere any way I can see if ctrl and s are hit in the space of 1 second


poopla(Posted 2003) [#4]
uh... why don't you just do,

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

?


Agamer(Posted 2003) [#5]
thats what the code above is but you have to hit them at the exactly same time


Perturbatio(Posted 2003) [#6]
try using keydown instead, see if that makes a difference.


(tu) sinu(Posted 2003) [#7]
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


WolRon(Posted 2003) [#8]
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.


Rottbott(Posted 2003) [#9]
Why not simply:

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


?


Agamer(Posted 2003) [#10]
As you have to hit them at the exactly same time


Ross C(Posted 2003) [#11]
no, not really. Keydown will report the key being pressed as long as it is pressed.