-=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- (c) WidthPadding Industries 1987 0|539|0 -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=-
SoCoder -> Snippet Home -> Misc


 
Jayenkai
Created : 07 May 2007
 
Language : Blitz

Redefinable Controls

Quick and easy redefinable key functions.

First off, here's the 2 functions.



Use FindButton(), which goes through all keys, and then Joypad controls, checking to see what's pushed. Record the outputted value, then check it with HitButton(value)

A short example..


 

Comments


Wednesday, 09 May 2007, 11:57
Paul
err... this just locks up :S
Adding a delay in the
For keychk=1 To 255
If KeyDown(keychk) Then out=keychk
Delay 1;<--
Next
allows me to close the program with the ex instead of taskmanager.

Dont know if it's got anything to do with my wacky joystick?
Wednesday, 09 May 2007, 14:50
Jayenkai
Yeah, could be a wacky joystick.. Probably best to disable joystick support until the player enables it.
Thursday, 10 May 2007, 07:23
Paul
anyway, here's a function to get the name of the key pressed
Needs user32.decels
GetKeyNameText% (lParam%,lpBuffer*,nSize%):"GetKeyNameTextA"

My decels file didn't have the star after the lpBuffer so it didn't work at first.

Thursday, 22 May 2008, 07:42
Jayenkai


A "More or less" complete Scancode -> Keyname function.