//by Qugurun do if GetRawKeyPressed(27) //Esc Exit //Close App endif loop
// Exit when Escape key has been pressed while GetRawKeyPressed(27) <> 1 Print( ScreenFPS() ) Sync() endwhile
//Combo Input //agk v2.0.14b //MR 28.06.2015 global joystick joystick=1 myCombo as string[64] myCombo[0] = "Up,Down,Up," myCombo[1] = "A,A,A," myCombo[2] = "A,B,X,Y," myCombo[3] = "B,B," myCombo[4] = "X,X,X," myCombo[5] = "Y,A,B," myCombo[6] = "A,A,B," timeout=timer() local sequence as string type byRef value as string endtype local UpLast as byRef local DownLast as byRef UpLast.value="" DownLast.value="" do print(sequence) l1=len(sequence) sequence = sequence + InputA() + InputB() + InputX() + InputY() + InputUp(UpLast) + InputDown(DownLast) l2=len(sequence) if l2>l1 //before after check //it grow up timeout=timer() endif if timer()-timeout>0.75 //grow up timeout, clear sequence timeout=timer() //.. maybe here check current value before clear ... sequence="" endif index=-1 for c=0 to 6 //max. combos if sequence=myCombo[c] index=c //found sequence sequence="" //clear sequence exit endif next if index=>0 lastcombo$=myCombo[index] endif print("Last Combo: " + lastcombo$) if GetPointerPressed() then exit sync() loop end function InputA() ret$="" if GetRawKeyPressed(65)=1 then ret$="A," if GetRawJoystickButtonPressed(joystick,1) then ret$="A," endfunction ret$ function InputB() ret$="" if GetRawKeyPressed(66) then ret$="B," if GetRawJoystickButtonPressed(joystick,2) then ret$="B," endfunction ret$ function InputX() ret$="" if GetRawKeyPressed(88) then ret$="X," if GetRawJoystickButtonPressed(joystick,3) then ret$="X," endfunction ret$ function InputY() ret$="" if GetRawKeyPressed(89) then ret$="Y," if GetRawJoystickButtonPressed(joystick,4) then ret$="Y," endfunction ret$ function InputUp(Last ref as byRef) ret$="" if GetRawKeyPressed(38) then ret$="Up," if Last.value <> "Up," and GetRawJoystickY(joystick) < -0.25 ret$="Up," Last.value=ret$ endif if GetRawJoystickY(joystick) > -0.25 then Last.value="" endfunction ret$ function InputDown(Last ref as byRef) ret$="" if GetRawKeyPressed(40) then ret$="Down," if Last.value <> "Down," and GetRawJoystickY(joystick) > 0.25 ret$="Down," Last.value=ret$ endif if GetRawJoystickY(joystick) < 0.25 then Last.value="" endfunction ret$
#constant KEY_BACK 8 #constant KEY_TAB 9 #constant KEY_ENTER 13 #constant KEY_SHIFT 16 #constant KEY_CONTROL 17 #constant KEY_ESCAPE 27 #constant KEY_SPACE 32 #constant KEY_PAGEUP 33 #constant KEY_PAGEDOWN 34 #constant KEY_END 35 #constant KEY_HOME 36 #constant KEY_LEFT 37 #constant KEY_UP 38 #constant KEY_RIGHT 39 #constant KEY_DOWN 40 #constant KEY_INSERT 45 #constant KEY_DELETE 46 #constant KEY_0 48 #constant KEY_1 49 #constant KEY_2 50 #constant KEY_3 51 #constant KEY_4 52 #constant KEY_5 53 #constant KEY_6 54 #constant KEY_7 55 #constant KEY_8 56 #constant KEY_9 57 #constant KEY_A 65 #constant KEY_B 66 #constant KEY_C 67 #constant KEY_D 68 #constant KEY_E 69 #constant KEY_F 70 #constant KEY_G 71 #constant KEY_H 72 #constant KEY_I 73 #constant KEY_J 74 #constant KEY_K 75 #constant KEY_L 76 #constant KEY_M 77 #constant KEY_N 78 #constant KEY_O 79 #constant KEY_P 80 #constant KEY_Q 81 #constant KEY_R 82 #constant KEY_S 83 #constant KEY_T 84 #constant KEY_U 85 #constant KEY_V 86 #constant KEY_W 87 #constant KEY_X 88 #constant KEY_Y 89 #constant KEY_Z 90 #constant KEY_F1 112 #constant KEY_F2 113 #constant KEY_F3 114 #constant KEY_F4 115 #constant KEY_F5 116 #constant KEY_F6 117 #constant KEY_F7 118 #constant KEY_F8 119 #constant KEY_S1 186 #constant KEY_S2 187 #constant KEY_S3 188 #constant KEY_S4 189 #constant KEY_S5 190 #constant KEY_S6 191 #constant KEY_S7 192 #constant KEY_S8 219 #constant KEY_S9 220 #constant KEY_S10 221 #constant KEY_S11 222 #constant KEY_S12 223