Scripts / Reading nil key input

Author
Message
AuShadow
GameGuru TGC Backer
10
Years of Service
User Offline
Joined: 2nd Dec 2013
Location: Australia
Posted: 21st Apr 2015 06:19
Hey all have this, but need it to not repeat untill after key release so tried using "nil" as key input to get a reset but doesn't work, any idea's, cheers

PC Specs: Windows 7 home 64-bit, Amd 7900 3gb DDR5 graphics, 8gb DDR3 Ram, Intel i7 3.4ghz
AuShadow
GameGuru TGC Backer
10
Years of Service
User Offline
Joined: 2nd Dec 2013
Location: Australia
Posted: 21st Apr 2015 06:22 Edited at: 21st Apr 2015 07:33
never mind solved it, if anyone else wanted to know i used not equal to heres the modified for comparison:

PC Specs: Windows 7 home 64-bit, Amd 7900 3gb DDR5 graphics, 8gb DDR3 Ram, Intel i7 3.4ghz
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 21st Apr 2015 10:21
just incase you or anyone needs it in future nothing for InKey is ""

life\'s one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11
!nullptr
Forum Support
9
Years of Service
User Offline
Joined: 27th Mar 2015
Location: Australia
Posted: 21st Apr 2015 11:07
smallg? Does this stop the call to a single positive so something can be toggled? (ie: i for inventory on/off.)

atm I'm "i" for on and "Shift+i" for off because of the multiple calls.
Development/ Gaming Rigs
Sys 1: i7-4770 (3.5)/16Gb/128 SSD/3Tb/970gtx/2 x 23, 1 x 27 LCD - Sys 2: i7/8Gb/670gtx/1.5Tb/1 x 23 LCD - Sys 3: Amd Quad/8Gb/645gtx/1Tb/30" LCD
PM
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 21st Apr 2015 11:15
yes if you use a toggle variable and the check to reset it, aushadow's code above lets you only press x or z only once until you release them
life\'s one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11
AuShadow
GameGuru TGC Backer
10
Years of Service
User Offline
Joined: 2nd Dec 2013
Location: Australia
Posted: 21st Apr 2015 22:00
Yes I know the issue you're having well, if you study the code in the second post I have in this thread you can see that for the x key, I have a check for input and also for the local variable pressedx, this is so I can set pressedx to 1 when its pressed which will stop the code from repeating until pressedx = 0 again. Same thing will work for opening and closing your inventory, in that code I have used a not equal to check to reset the pressed variable but as smallg has noted you can simply leave the inkey section blank to detect if equal to no key pressed to achieve the same thing. Hope that helps
PC Specs: Windows 7 home 64-bit, Amd 7900 3gb DDR5 graphics, 8gb DDR3 Ram, Intel i7 3.4ghz
!nullptr
Forum Support
9
Years of Service
User Offline
Joined: 27th Mar 2015
Location: Australia
Posted: 21st Apr 2015 22:31
Awesome stuff gentlemen. Another "fix" (off my list anyway) dispatched accordingly
Development/ Gaming Rigs
Sys 1: i7-4770 (3.5)/16Gb/128 SSD/3Tb/970gtx/2 x 23, 1 x 27 LCD - Sys 2: i7/8Gb/670gtx/1.5Tb/1 x 23 LCD - Sys 3: Amd Quad/8Gb/645gtx/1Tb/30" LCD
PM

Login to post a reply

Server time is: 2024-05-06 09:48:22
Your offset time is: 2024-05-06 09:48:22