New key binding

New key binding

Postby Cloter » 05 May 2018, 18:24

How can I create a new binding for a key, let's say PgUp/PgDn, and have them do the same action as 'arrow up/arrow down". After I get this to work I can go from there and have PgUp/PgDn alter a new variable (to be created). So far ... I've created a new binding in the 'input.h' and also in 'keyboard_config.cpp'.. But I'm missing the next steps to make the event get to the input_manager.cpp. I'm stuck... :( I appreciate any help on this!
Cloter
 
Posts: 4
Joined: 02 May 2018, 06:09

Re: New key binding

Postby Alayan » 05 May 2018, 19:45

Why are you trying to edit the code, rather than editing the configuration ?

And if you want 2 keys able to do the same action, create a second config, put all the unwanted menu actions under a menu key controlled by the first config (this disable them), and put the wanted keys for the wanted actions in the second config.
Alayan
 
Posts: 92
Joined: 25 Mar 2012, 22:11

Re: New key binding

Postby Cloter » 05 May 2018, 20:03

Yes, I am editing the code. The second configuration file wont do for me.. I mentioned PgUp/Pgdn as an example only - sorry if it was confusing.. I want to understand how to create a new biding in the code because I will be working with a new variable I am going to create.
Cloter
 
Posts: 4
Joined: 02 May 2018, 06:09

Re: New key binding

Postby Auria » 05 May 2018, 23:52

Could you describe a bit more precisely what you are trying to achieve? It's hard to offer proper guidance when I'm unsure what you're trying to do

Anyway, take a look at the "input" folder in the STK source folder. "input_manager" is the central point, and there's objects to manage configurations and various device types (keyboard, gamepad)
Image
User avatar
Auria
STK Moderator
 
Posts: 2869
Joined: 07 Dec 2009, 03:52

Re: New key binding

Postby Cloter » 06 May 2018, 13:42

Thanks Auria, I'll look into it (input_manager and related objects). Later I'll post more specific stuff about what I'm doing! And, of course, great project!
Cloter
 
Posts: 4
Joined: 02 May 2018, 06:09

Who is online

Users browsing this forum: No registered users and 1 guest