Disable keyboard input with events?

Get help using Construct 2

Post » Sat Dec 12, 2015 5:09 am

Hi is it possible to disable keyboard input in an "IF" or an "OR" statement/event?
I can't seem to figure this one out.

I'm not using behaviors, so I would want to do this straight in the event sheet.

Also is it possible to lock one key once the other key is pressed? For example if arrow down is being held, pressing arrow up simultaneously won't do anything.
At the moment pressing 2 keys together messes up my values.

Thanks a bunch as always!


EDIT: Im starting to think its not possible to entirely disable someones input in order not to leave the user "hanging" and unable to do anything on their computer, including closing the game.
Brick by brick, stone by stone.
B
50
S
22
G
13
Posts: 273
Reputation: 10,413

Post » Sat Dec 12, 2015 6:13 am

Ok I got it working.

For anyone that is interested, I created a variable:
Keyboard_input_toggle = 1

Nested all the keyboard controls in an IF Keyboard_input_toggle=1.

Then when I wanted to disable keyboard for certain controls, just created and IF event (something happens) ---> Keyboard_input_toggle = 0
Brick by brick, stone by stone.
B
50
S
22
G
13
Posts: 273
Reputation: 10,413

Post » Sat Dec 12, 2015 9:40 am

You could put the keyboard-events in a group and activate/deactivate the group in the same way..
Might also help making you even-sheet easier to view..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Sat Dec 12, 2015 9:54 am

@LittleStain

Deactivating/Activating group? Wow, that is sweet!
Thanks for the info, now time to delete some global variables and settle for group toggling for some situation, Ill get my event sheet cleaner for sure!
Brick by brick, stone by stone.
B
50
S
22
G
13
Posts: 273
Reputation: 10,413


Return to How do I....?

Who is online

Users browsing this forum: Congrats2u and 8 guests