Changing/ adding key commands to game

Status
Not open for further replies.

PhxFire

The Eternal Flame
Veteran
Joined
Jul 1, 2019
Messages
131
Reaction score
68
First Language
English
Primarily Uses
RMMV
Basically I want to clone the functions of the ESC key to the Backspace key in MV. Is this possible, also are you able to program in new commands to keys, or swap keys out for other ones?

Thanks!
 

standardplayer

Keeper of Kitties
Veteran
Joined
Apr 6, 2016
Messages
698
Reaction score
3,448
First Language
English
Primarily Uses
N/A

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,293
Reaction score
11,710
First Language
English
Primarily Uses
RMVXA
Game Mechanic Design is for looking at aspects of game play at a more conceptual level. "How do I...? (Implementation) questions belong in the Support forum for the engine you are using.

[move]JS Plugin Requests[/move]
 

PhxFire

The Eternal Flame
Veteran
Joined
Jul 1, 2019
Messages
131
Reaction score
68
First Language
English
Primarily Uses
RMMV
@standardplayer So I checked out the keyboard config but I'm unable to assign anything to the backspace key... is there a reason for this?
 

standardplayer

Keeper of Kitties
Veteran
Joined
Apr 6, 2016
Messages
698
Reaction score
3,448
First Language
English
Primarily Uses
N/A
I see that, I actually never knew it didn't let you use the full keyboard until now, I guess I hadn't noticed it. That being said, there is a way to way to add an event for the backspace key fairly easily.
What I don't know how to do is access the event code of the Esc key, or emulate pressing it. I've been researching it for a bit now, I'll let you know if I find either of those things.

In the meantime, however, the Keyboard Config plugin does let you pick from nearly any button, does it absolutely have to be backspace?
 

bazrat

Pixel Game Maker MV
Veteran
Joined
Oct 15, 2018
Messages
241
Reaction score
176
First Language
English
Primarily Uses
Other
search DK full input, its amazing
 

PhxFire

The Eternal Flame
Veteran
Joined
Jul 1, 2019
Messages
131
Reaction score
68
First Language
English
Primarily Uses
RMMV
@bazrat I checked out the DK tools and they seem cool, but I get a Now Loading... screen everytime I launch the game now even with everything disabled in DK Tools
 

bazrat

Pixel Game Maker MV
Veteran
Joined
Oct 15, 2018
Messages
241
Reaction score
176
First Language
English
Primarily Uses
Other
@bazrat I checked out the DK tools and they seem cool, but I get a Now Loading... screen everytime I launch the game now even with everything disabled in DK Tools
Well that sucks, lol
 

PhxFire

The Eternal Flame
Veteran
Joined
Jul 1, 2019
Messages
131
Reaction score
68
First Language
English
Primarily Uses
RMMV
I've decided to abandon this idea for now and just hold out hope that Yanfly adds support for the backspace key haha
 

Aloe Guvner

Walrus
Veteran
Joined
Sep 28, 2017
Messages
1,628
Reaction score
1,115
First Language
English
Primarily Uses
RMMV
Don't give up!

You don't need a fancy plugin that's thousands of lines long with dozens of features to do this -- it's literally one line of code:

Code:
Input.keyMapper[8] = 'escape'
^^ Add that as a new plugin and the Backspace key will do the exact same thing as the Escape key.

The keyMapper maps keys from a number to a word. The number is the literal ASCII value of the key, and the word is what RMMV will check for. That way, you can have multiple keyboard keys that do the same thing inside MV.

To see the default mapping, just open your console in a playtest and type in "Input.keyMapper"

upload_2019-7-8_20-44-46.png

To discover what numbers correspond to which keyboard keys, you should be able to look that up pretty easily.
 

PhxFire

The Eternal Flame
Veteran
Joined
Jul 1, 2019
Messages
131
Reaction score
68
First Language
English
Primarily Uses
RMMV
@Aloe Guvner you're a life saver! See that's why I love this site, I'm here thinking of all these complex ways to try and work around it and I didn't even think of adding my own code through a plugin [Facepalm]
 
Status
Not open for further replies.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

mlogan wrote on alltheyuriz's profile.
Please be aware that our Status rules ask members not to make more than 2 status updates in 24 hours.
rux
Just 80% of my motivation on game making lmao, anyone got tips on how to not be unmotivated?
I've signed up for a job training program for people with Asperger's Syndrome. I went to a "test run" today so they could see how well I did with simple jobs, and I amazed them. Most new people do it in 30+ minutes, while I finished in a mere 15 minutes. Gives me time to work on a screenplay for Studio MDHR...
People,I have seen that Someone from China/Chile and London is doing a Vaccine Against COVID-19.

Forum statistics

Threads
105,467
Messages
1,013,917
Members
137,108
Latest member
maxmach
Top