How do you script call to check for keyboard button?

Ashtonion

Classic Creator
Veteran
Joined
Jan 3, 2014
Messages
112
Reaction score
0
First Language
english
Primarily Uses
I know that the numberpad up down left and right can't be checked for being pressed without a script, so how would i do so? I want to be able to move a separate event  using those keys.......
 

♥SOURCE♥

Too sexy for your party.
Veteran
Joined
Mar 14, 2012
Messages
693
Reaction score
411
Primarily Uses
Hello! In the fourth (final) tab of Conditional Branch (Event Command) you can check for button input, a dropdown menu will let you pick a key from a list of available keys.

If you want to use a script call, it would be something like Input.trigger?:)SYMBOL), Input.press?:)SYMBOL) or Input.repeat?:)SYMBOL), depending on the behavior you want. :SYMBOL would be the actual symbol representing the key, like :DOWN, :LEFT, :RIGHT, :UP, :X, :R, etc. Check "Input" module reference in the help file for more information. :)
 

Ashtonion

Classic Creator
Veteran
Joined
Jan 3, 2014
Messages
112
Reaction score
0
First Language
english
Primarily Uses
Yes but in conditional branch, the numberpad keys aren't there, its only a few letters and the up down left and right that's under the enter key. I need to use the numberpad directions
 

EDIT: So what would the script call be for a Number Pad Key? (8=up 2 = down 4=left 6=right)
 
Last edited by a moderator:

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,359
Reaction score
7,672
First Language
German
Primarily Uses
RMMV
you can check for button input,
That is exactly the important part, and because of that most of the rest of your answer is wrong.
RM chacks for button input, it cannot check for any keyboard input.


The button :A is NOT the same as the key A on the keyboard.


RM's input simulates a gamepad, that's why the button codes include :R and :L but not the regular keyboard options.


Additionally there is a configuration setting available by F1 ingame that allows the player to change the keyboard mapping and define different keys than the default to stand for :A, :B and so on.


To check for keyboard input you first have to use a script that gives you keyboard input, otherwise you'll always be limited to the keys available on configuration. And if you use such a script, the script call to check for any input depends on the script and can't be described in general.
 

♥SOURCE♥

Too sexy for your party.
Veteran
Joined
Mar 14, 2012
Messages
693
Reaction score
411
Primarily Uses
Yes but in conditional branch, the numberpad keys aren't there, its only a few letters and the up down left and right that's under the enter key. I need to use the numberpad directions

EDIT: So what would the script call be for a Number Pad Key? (8=up 2 = down 4=left 6=right)
The number pad keys are not supported in the default Input module of RPG Maker. You would need a custom input script to support those keys.

I would advice against using those keys though, not every keyboard has them, and it is possible that not all of your players will have them.

That is exactly the important part, and because of that most of the rest of your answer is wrong.

RM chacks for button input, it cannot check for any keyboard input.

The button :A is NOT the same as the key A on the keyboard.

RM's input simulates a gamepad, that's why the button codes include :R and :L but not the regular keyboard options.

Additionally there is a configuration setting available by F1 ingame that allows the player to change the keyboard mapping and define different keys than the default to stand for :A, :B and so on.

To check for keyboard input you first have to use a script that gives you keyboard input, otherwise you'll always be limited to the keys available on configuration. And if you use such a script, the script call to check for any input depends on the script and can't be described in general.
My answer is not wrong, I never said that the :A symbol represents the :A key, I told them to check the default Input documentation in the help file if they wanted to use a script call :)
 

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,846
First Language
English
Yes but in conditional branch, the numberpad keys aren't there, its only a few letters and the up down left and right that's under the enter key. I need to use the numberpad directions


EDIT: So what would the script call be for a Number Pad Key? (8=up 2 = down 4=left 6=right)
RPG Maker does not support numpad by default.


One solution is to use a script that will allow you to check for keyboard input, or a script that will allow you to bind numpad keys to the default buttons (which would probably be covered by a keyboard input script)
 

Solistra

Veteran
Veteran
Joined
Aug 15, 2012
Messages
593
Reaction score
247
Primarily Uses
I would advice against using those keys though, not every keyboard has them, and it is possible that not all of your players will have them.
This. So many times... this.


I don't have a number pad on my computer, nor do many users who primarily use a laptop with a limited keyboard, meaning that the usage of the number pad often requires a little bit of finger gymnastics using the fn key (or the OEM equivalent for the laptop).
 

??????

Diabolical Codemaster
Veteran
Joined
May 11, 2012
Messages
6,513
Reaction score
3,203
First Language
Binary
Primarily Uses
RMMZ
https://github.com/Dekita/Dekyde-Ace/tree/master/Input

The link above contains an array of scripts to provide additional control or add cool features to the input system.  None of the scripts in the link above are available for commercial games.  The 'Input' script itself allows for checking any key press. (it also requires the 'Virtual Key Codes' script to function) :)
 
Last edited by a moderator:

Ashtonion

Classic Creator
Veteran
Joined
Jan 3, 2014
Messages
112
Reaction score
0
First Language
english
Primarily Uses
Lol. I'm not worried about other people's computers because i'm keeping this game to myself.
 

Hudell

Dog Lord
Veteran
Joined
Oct 2, 2014
Messages
3,545
Reaction score
3,715
First Language
Java's Crypt
Primarily Uses
RMMZ
The problem with Input scripts is that they usually remove the default gamepad support that Rpg Maker has.
 

??????

Diabolical Codemaster
Veteran
Joined
May 11, 2012
Messages
6,513
Reaction score
3,203
First Language
Binary
Primarily Uses
RMMZ
< working on full DirectX9 gamepad input as part of y input system - for obtaining full usage of the keys given from say, an xbox controller.  Not sure when that will be finished though. :/
 

Hudell

Dog Lord
Veteran
Joined
Oct 2, 2014
Messages
3,545
Reaction score
3,715
First Language
Java's Crypt
Primarily Uses
RMMZ
If I had any way to know what modules/functions are called on the default Input::trigger? method, I would me more than happy already.
 

Heretic86

Veteran
Veteran
Joined
Nov 30, 2014
Messages
240
Reaction score
167
First Language
Engrish
Primarily Uses
Two possible solutions come to mind.

#1 - Find a Keyboard Input Script and look at its code

#2 - Fullscreen Scripts

Keyboard should be pretty obvious, but a Fullscreen Script works very similarly by simulating the keypresses of ALT+Enter.

      # Alt Enter to go to Fullscreen
      showm = Win32API.new 'user32', 'keybd_event', %w(l l l l), ''
      showm.call(18,0,0,0)  # Hold the Alt Keyboard key
      showm.call(13,0,0,0)  # Hold the Enter Keyboard key
      showm.call(13,0,2,0)  # Release the Enter Keyboard key
      showm.call(18,0,2,0)  # Release the Alt Keyboard key

A bit over my head to explain, and also doesnt detect Input, but simulates it.
 

??????

Diabolical Codemaster
Veteran
Joined
May 11, 2012
Messages
6,513
Reaction score
3,203
First Language
Binary
Primarily Uses
RMMZ
There is no way to gain access to the default input methods; however, one would imagine that they use similar calls to the user32 dll, either calling GetKeyboardState or GetKeyState an insane amount of times for each key (i think the latter considering my input update is faster than the defaults (which should be much faster as it uses a more powerful code than ruby))

Edit: feel free to check my scripts for how i detect the key information. :)
 
Last edited by a moderator:

Bex

Veteran
Veteran
Joined
Aug 2, 2013
Messages
1,492
Reaction score
408
First Language
German
Primarily Uses
RMMV
I also would like a Link to a non Buggy full Functional Keyboard Script someone Tested and therefor can recoment.

I dont need Game Pad Possibility this Time.

Someone has expirience with this?
 

??????

Diabolical Codemaster
Veteran
Joined
May 11, 2012
Messages
6,513
Reaction score
3,203
First Language
Binary
Primarily Uses
RMMZ
I also would like a Link to a non Buggy full Functional Keyboard Script someone Tested and therefor can recoment.

I dont need Game Pad Possibility this Time.

Someone has expirience with this?
Are you saying my input script is buggy?  I linked it above and dont see why you would need an alternative. :)
 

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

Latest Threads

Latest Posts

Latest Profile Posts

Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c

Forum statistics

Threads
105,857
Messages
1,017,019
Members
137,564
Latest member
McFinnaPants
Top