Full Input - All keys of the keyboard and gamepad

Title: Full Input
Author: DKPlugins
Version: 5.3.0
Description:
All keys of the keyboard and gamepad.

Features:
  • Checking the press of any key on the keyboard or gamepad
  • Support for gamepad sticks and triggers
  • Enabling switches when you press a key

Compatibility:
  • RPG Maker MV: 1.5+
  • RPG Maker MZ: 1.0+

Warning from "Help"

Default RPG Maker MV/MZ values for Alt, Space, Insert, Q, W, X, Z
Alt: 'control'
Space: 'ok'
Insert: 'escape'
Q: 'pageup'
W: 'pagedown'
X: 'escape'
Z: 'ok'

The values of this plugin for Alt, Space, Insert, Q, W, X, Z
Alt: 'alt'
Space: 'space'
Insert: 'insert'
Q: 'q'
W: 'w'
X: 'x'
Z: 'z'

Tested gamepads:
Xbox One (wired and wireless) - 100%
PS5 DualSense - 100% (experimental support)

Instruction from "Help"
Spoiler
###===========================================================================
## Added functions
###===========================================================================
Added tracking of gamepad triggers pressing and axis tilts
Tested on Xbox One Wireless Gamepad
Use to get values:
Input.gamepad.lt - left trigger (float value of the force of pressing in the range from 0 to 1)
Input.gamepad.rt - right trigger (float value of the force of pressing in the range from 0 to 1)
Input.gamepad.axes - axes (Array with 4 float values)
The axes have the following structure:
[X-axis (left stick), Y-axis (left stick), X-axis (right stick), Y-axis (right stick)]

X-axis (any stick) is -1 when you tilt the stick to the left
X-axis (any stick) is 1 when you tilt the stick to the right
Y-axis (any stick) is -1 when you tilt the stick up
Y-axis (any stick) is 1 when you tilt the stick down

Input.preferGamepad () - Returns true if the player is playing a gamepad

Input.isAnyPressed(keys) - Returns true if at least one key is pressed (keys not specified).
Returns true if at least one key from the keys array is pressed (keys is an array of keys).

Input.isAnyTriggered(keys) - Returns true if at least one key is pressed and released (keys not specified).
Returns true if at least one key from the keys array is pressed and released (keys is an array of keys).

Input.isAnyRepeated(keys) - Returns true if pressing at least one key is repeated (keys not specified).
Returns true if pressing at least one key from the keys array is repeated (keys is an array of keys).

Input.isAnyLongPressed(keys) - Returns true if at least one key is pressed for a long time (keys not specified).
Returns true if at least one key from the keys array is pressed for a long time (keys is an array of keys).

Input.getPressedTime (keyName) - Returns the time the keyName was pressed in frames.

Input.virtualClick(keyName) - Emulation of pressing the keyName button.

Input.resetKeyboardButtons() - Resets the keyboard buttons

Input.resetGamepadButtons() - Resets the gamepad buttons

If you create a plugin based on this:
Before using any function, make sure that the user has installed the plugin:
if (Imported.DK_Full_Input) {}

Get plugin version:
var version = Imported.DK_Full_Input;

"Help" languages: English, Russian

Terms of use
You can:
-To use the plugin for your non-commercial projects
-Change code of the plugin

You cannot:
-Delete or change any information about the plugin
-Distribute the plugin and its modifications

Details on obtaining a commercial license on my website

Plugin page:
https://dk-plugins.ru/full-input/
Update to version 2.0


Updated translations


Added support for gamepad right stick, left stick separated from arrow keys and added a lot of function for keys check (all information in plugin "Help")


Also warns that when you install the plugin, you can not walk on the left stick gamepad, because he has a new settings (this is also stated in the "Help")
Hi there @DK, this plugin might be just what we have been looking for for weeks now ...


However, the issue we have is that the buttons don't seem to map to keys when we change them in the js file. Here is what we have changed ...



// Код клавиши: символ в кавычках
// Key code: symbol in quotes
Input.gamepadMapper = {
0: 'ok', // A
1: 'cancel', // B
2: 'shift', // X
3: ‘e’, // Y
4: 'pageup', // LB (L1)
5: 'pagedown', // RB (R1)
6: 'lt', // LT (L2)
7: 'rt', // RT (R2)
8: ‘m’, // Select


The issue here is that we are also using Yanfly's Keyboard Common Events, and we run one common event when the player presses the E key, and one when they press M


Could you possibly assist in getting your plugin to work with Yanfly's one? Happy to pay for this ...
New version


Fix for 'y' button


Added '/' button


Optimisation and documentation
Just what I was looking for. 🙂  Is this free for commercial use?
Just what I was looking for. 🙂  Is this free for commercial use?

Yes. Full terms of use you may find in the "Help" of plugin
Hello DK, really appreciate your work on this plugin, but was wondering if you or another knowledgeable poster could assist me.


I am having a similar issue as @Eff-n-Geoff. I can't seem to get the plug-in to work as intended.


When it is active I can only get the 8 regular buttons to work (d-pad, a, b, x, y). The analog sticks don't work at all, and editing the file to have a button press a different button yields no change. 


When I edit the .js file, Am I to only update the "Input.keyMapper = {" information?


I am basically trying to get a gamepad button to press the "j" button on the keyboard, thus running a common event, "jump."


Any help would be appreciated. 
Привет DK, очень ценю вашу работу над этим плагином, но было интересно, если вы или другой осведомленный плакат мог бы помочь мне.


У меня такой же вопрос , как @ Eff-н-Джеффа . Я не могу показаться , чтобы получить плагин , чтобы работать , как предполагалось.


Когда она активна, я могу получить только 8 регулярные кнопки для работы (D-Pad, а, Ь, х, у). Аналоговые палочки не работают вообще, а также редактирование файла, чтобы иметь кнопку нажать другую кнопку выходов никаких изменений. 


Когда я отредактировать файл .js, Должен ли я обновить только "Input.keyMapper = {" информацию?


Я в основном пытаются получить кнопку геймпада нажать на кнопку "J" на клавиатуре, таким образом, работает общее событие, "прыжок".


Любая помощь будет оценена. 



Hi
"Input.keyMapper" for keyboard
"Input.gamepadMapper" for gamepad


You can create parallel event. Add "Conditional Branch" and use script. (All scripts you can find in plugin Help)

Spoiler
2017-01-31_15-53-11.png2017-01-31_15-54-03.png
Plugin updated to version 3.0

Settings are transferred from the file to the plugin itself
Added the ability to turn on the switch when you press a key
Thank you very much for this. Such a game changer as for as quality of life!
If you use YEP_KeyboardConfig plugin, then place DKTools_Full_Input plugin higher (if you are experiencing problems).
This plugin has taken me a bit to figure out. I figured out most the gamepad buttons but I cannot for the life of me figure out how to set the LR trigger and LR buffers of the gamepad to a conditional statement.

Currently I use
Code:
Input.keyPressed(null, 5)
5 = pagedown according to the gamepad settings. But it will not run the test message when I hit pagedown (which I'm guess that is right buffer, either way I hit all the buttons and don't get anything). Am I doing something wrong for the triggers/buffer buttons?
This plugin has taken me a bit to figure out. I figured out most the gamepad buttons but I cannot for the life of me figure out how to set the LR trigger and LR buffers of the gamepad to a conditional statement.

Currently I use
Code:
Input.keyPressed(null, 5)
5 = pagedown according to the gamepad settings. But it will not run the test message when I hit pagedown (which I'm guess that is right buffer, either way I hit all the buttons and don't get anything). Am I doing something wrong for the triggers/buffer buttons?
What version of the plugin are you using? And are there any other plugins to change the keyboard / gamepad?
What version of the plugin are you using? And are there any other plugins to change the keyboard / gamepad?

Thanks for the reply DK. I am using the current version and I actually found the problem, it was yanflys Gamepadconfig plugin(it was below yours). It seems like it reset everything when I loaded up the game. I turned that off and got it all working again. xD
Sorry to bother @DK but I am just wondering if you have a screenshot of the section I need to edit. Trying to figure it all out. I'm just confused as to where in the js file I need to go. Thanks in advance.
Sorry to bother @DK but I am just wondering if you have a screenshot of the section I need to edit. Trying to figure it all out. I'm just confused as to where in the js file I need to go. Thanks in advance.
All keyboard and gamepad settings are in the plugin parameters. In the program, not in the file itself.
All keyboard and gamepad settings are in the plugin parameters. In the program, not in the file itself.

I can't seem to get the buttons to work when changing them in the parameters themselves. I could set it up with a parallel event like you were talking about, but the problem is, to put parallel events on every map so that it reads when the player presses the button, isn't exactly the best, since I assume that would cause some lag. Maybe I am missing exactly how I am to set it up. Sorry for the questions. Basically I am just trying to figure out how to get the left and right bumper (L1)/(R1) to be used in game, but if I set the buttons up in the parameter and try them out, they don't work at all, as well as for some reason the thumb sticks don't work at all when your plugin is active, but they do when it's disabled.
I can't seem to get the buttons to work when changing them in the parameters themselves. I could set it up with a parallel event like you were talking about, but the problem is, to put parallel events on every map so that it reads when the player presses the button, isn't exactly the best, since I assume that would cause some lag. Maybe I am missing exactly how I am to set it up. Sorry for the questions. Basically I am just trying to figure out how to get the left and right bumper (L1)/(R1) to be used in game, but if I set the buttons up in the parameter and try them out, they don't work at all, as well as for some reason the thumb sticks don't work at all when your plugin is active, but they do when it's disabled.
I made a demo for you: DropBox
I configured the keys L1 (LB ) and R1 (RB )
In the settings of the gempad these keys are numbered 4 and 5.
I also set the switches to turn on automatically when these keys are pressed (see the third item in the plugin settings).
Now that everything is set up, you can create common events that work on these switches. I created 2 common events, watch them. They will be activated only when the corresponding keys are pressed.

If you are unsuccessful or have any questions, ask again.
@DK Thanks man, I will try it out!
Plugin updated to version 3.1.0

What's new:
  • Added a description of the buttons (keyboard and gamepad) in the settings
  • Added tracking of gamepad axes and force of pressing triggers
  • Added gamepad tracking function
  • Help updated
  • Removed unused functions
Plugin now requires minimum DKTools 8.3.0

First post updated!

Original thread: https://forums.rpgmakerweb.com/threads/full-input-all-keys-of-the-keyboard-and-gamepad.59640/