How do I capture all keys for custom controls

Get help using Construct 2

Post » Fri Jul 11, 2014 10:27 pm

Today I started working on adding custom keyboard controls to my game. Here is the basic layout of whats going on:

https://drive.google.com/file/d/0B3lKeuuQtQB6YlFoRy1pZTY3d1U/edit?usp=sharing
https://drive.google.com/file/d/0B3lKeuuQtQB6X3JEenh2M2l5Q2M/edit?usp=sharing
https://drive.google.com/file/d/0B3lKeuuQtQB6eVpFaTN2WDFablE/edit?usp=sharing

(for some reason the boards upload limit has been it so I cannot just attach the png's)

Everything works pretty good except I cannot capture special keys such as tab, shift, space, enter, ctrl, arrow keys, so forth. Am I just going about this wrong or is there something additional I am going to have to do to make those keys available for the user to assign? Thanks in advance for any help rendered.
Founder of HeroicTek
HeroicTek.com
Owner of HeroicDomains
HeroicDomains.com
B
21
S
7
G
1
Posts: 157
Reputation: 2,020

Post » Fri Jul 11, 2014 10:30 pm

This tutorial will help you out a bit, https://www.scirra.com/tutorials/106/the-start-page
B
7
S
1
Posts: 57
Reputation: 484

Post » Fri Jul 11, 2014 11:18 pm

Based on the fact that you just made about 30 posts in as many minutes, I am going to say you are either a bot, reputation farming, or didn't actually read the question. The link you supplied has nothing to do with my question and would help no one. The question is still open for those who actually have some real input. Thank you in advance for any help rendered.
Founder of HeroicTek
HeroicTek.com
Owner of HeroicDomains
HeroicDomains.com
B
21
S
7
G
1
Posts: 157
Reputation: 2,020

Post » Sat Jul 12, 2014 12:16 pm

@beardedeagle

Here's an example of setting Global variables to the name and code of the key pressed and displaying it on screen.

https://dl.dropboxusercontent.com/u/905 ... yCode.capx

Works for control (17), shift (16), tab (9), etc.

Some things like space and arrowkeys didn't show text, but did give the KeyCode, so in those special circumstances you could add in extra events to change the KeyName.
Vote for all the Construct 2 games on Steam Greenlight - Find them here
B
33
S
9
G
7
Posts: 450
Reputation: 6,780

Post » Sat Jul 12, 2014 4:22 pm

Thank you very much @OddConfection. I will study this.
Founder of HeroicTek
HeroicTek.com
Owner of HeroicDomains
HeroicDomains.com
B
21
S
7
G
1
Posts: 157
Reputation: 2,020

Post » Sat Jul 12, 2014 4:59 pm

@OddConfection The capx you gave me is great. You are right about the extra events, just add a value compare to set the keyname to what it should be for the arrowkeys.
Founder of HeroicTek
HeroicTek.com
Owner of HeroicDomains
HeroicDomains.com
B
21
S
7
G
1
Posts: 157
Reputation: 2,020


Return to How do I....?

Who is online

Users browsing this forum: Bootfit and 16 guests