入力クラスにキーを追加し、キーの再マッピングを可能にするプラグイン – QInput.js

タイトル
Adds additional keys to Input class, and allows remapping keys.
作者名
ヘルプ
============================================================================
## About
============================================================================
This plugin enables full keyboard support as well as letting you set the
default keyboard keys for mv inputs.
============================================================================
## Remap Default Keys
============================================================================
This allows you to change what keys input calls are related to.
You can set them to multiple keys by seperating each key with a comma.
You must use a QKey (Available keys listed below)
Keys are case sensative!!! Means #C is not the same as #c !!IMPORTANT!!
----------------------------------------------------------------------------
Example of changing to wasd format
----------------------------------------------------------------------------
Set the parameter for left to: `#a`

Set the parameter for right to: `#d`

Set the parameter for up to: `#w`

Set the parameter for down to: `#s`

Set the parameter for pagedown to: (page down uses w, so we'll change to e)

`#pagedown, #e`

Optional: Use f key instead of z in enter input

`#enter, #space, #f`

For FPS, Streched, FullScreen, Restart, Console you can only put 1 key!
Do not use the # idetifier.

If you want to disable one of those, set it to 0E. If you put in an
incorrect key, it will use default MV key
============================================================================
## QKeys List
============================================================================
All QKeys start with # and are lowercase

Modifier keys
- #space, #backspace, #tab, #enter, #pageup, #pagedown, #escape
- #shift, #ctrl, #alt, #esc, #left, #up, #right, #down

Numbers (Above letters)
- #0, #1, #2, #3, #4, #5, #6, #7, #8, #9

Numpad
- #num0, #num1, #num2, #num3, #num4
- #num5, #num6, #num7, #num8, #num9

Letters
- #a, #b, #c, ..., #z
(All letters between a-z US keyboard, just add a # infront)

Function Keys
- #f1, #f2, #f3, #f4, #f5, #f6, #f7, #f8, #f9, #f10, #f11, #f12

Special Characters
- #semicolon, #equal, #comma, #minus, #period, #singlequote
- #slash, #grave, #openbracket, #backslash, #closedbracket

============================================================================
## Gamepad Keys
============================================================================
Gamepad keys begin with $ and are in all caps.

Buttons:
- $A, $B, $X, $Y, $SELECT, $START

Triggers:
- $L1, $L2, $L3, $R1, $R2, $R3

DPad
- $UP, $DOWN, $LEFT, $RIGHT

_Gamepad key names are in xbox config_
============================================================================
## Using QKeys
============================================================================
If you haven't noticed by now, Qkeys have a # identifier. So if you want
to run a trigger check for left key you will run:
~~~
Input.isTriggered("#left");
~~~

If you didn't use the # and put
~~~
Input.isTriggered("left");
~~~
This will check for the keys you set for parameter left, so by default this
will let numberpad 4 to trigger this as well.

I also added an extra input check
~~~
Input.anyTriggered(keylist);
~~~
- Keylist is a string with keys seperated by commas.
- You can also set it to a-z, a-z0-9 or sym.
- If keylist is left empty it will return true when any key is pressed
=============================================================================
## Advanced Users: Using Window_TextInput
=============================================================================
This new window will allow for a keyboard input.
If you want to see how it is used please look at the code or look at
QNameInput.js as they both use Window_TextInput

There are also 2 new functions in game input which might be useful:
~~~
Input.preferKeyboard();
~~~
Will return true if the last input was sent with the keyboard.

~~~
Input.preferGamepad();
~~~
Will return true if the last input was sent with the gamepad.
============================================================================
## Links
============================================================================
Formated Help:

https://quxios.github.io/#/plugins/QInput

RPGMakerWebs:

http://forums.rpgmakerweb.com/index.php?threads/qplugins.73023/

Terms of use:

https://github.com/quxios/QMV-Master-Demo/blob/master/readme.md

Like my plugins? Support me on Patreon!

https://www.patreon.com/quxios

パラメータ
version 2.2.1
site https://quxios.github.io/
updateurl https://quxios.github.io/data/pluginsMin.json

param Threshold
desc The threshold for gamepad analog sticks to send input
MV Default: 0.5
type Number
decimals 2
min 0.10
max 1.00
default 0.5

param Input Remap

param Ok
parent Input Remap
desc Which buttons will trigger the ok input
MV Default: #enter, #space, #z, $A
type text[]
default ["#enter", "#space", "#z", "$A"]

param Escape / Cancel
parent Input Remap
desc Which buttons will trigger the escape / cancel input
MV Default: #esc, #insert, #x, #num0, $B
type text[]
default ["#esc", "#insert", "#x", "#num0", "$B"]

param Menu
parent Input Remap
desc Which buttons will trigger the menu input
MV Default: #esc, $Y
type text[]
default ["#esc", "$Y"]

param Shift
parent Input Remap
desc Which buttons will trigger the shift input
MV Default: #shift, #cancel, $X
type text[]
default ["#shift", "#cancel", "$X"]

param Control
parent Input Remap
desc Which buttons will trigger the control input
MV Default: #ctrl, #alt
type text[]
default ["#ctrl", "#alt"]

param Tab
parent Input Remap
desc Which buttons will trigger the tab input
MV Default: #tab
type text[]
default ["#tab"]

param Pageup
parent Input Remap
desc Which buttons will trigger the pageup input
MV Default: #pageup, #q, $L1
type text[]
default ["#pageup", "#q", "$L1"]

param Pagedown
parent Input Remap
desc Which buttons will trigger the pagedown input
MV Default: #pagedown, #w, $R1
type text[]
default ["#pagedown", "#w", "$R1"]

param Left
parent Input Remap
desc Which buttons will trigger the left input
MV Default: #left, #num4, $LEFT
type text[]
default ["#left", "#num4", "$LEFT"]

param Right
parent Input Remap
desc Which buttons will trigger the right input
MV Default: #right, #num6, $RIGHT
type text[]
default ["#right", "#num6", "$RIGHT"]

param Up
parent Input Remap
desc Which buttons will trigger the up input
MV Default: #up, #num8, $UP
type text[]
default ["#up", "#num8", "$UP"]

param Down
parent Input Remap
desc Which buttons will trigger the down input
MV Default: #down, #num2, $DOWN
type text[]
default ["#down", "#num2", "$DOWN"]

param Debug
parent Input Remap
desc Which buttons will trigger the debug input
MV Default: #f9
type text[]
default ["#f9"]

param ControlKeys Remap

param FPS
parent ControlKeys Remap
desc Which button will open fps
MV Default: f2
default f2

param Streched
parent ControlKeys Remap
desc Which button will strech Screen
MV Default: f3
default f3

param FullScreen
parent ControlKeys Remap
desc Which button will trigger fullscreen
MV Default: f4
default f4

param Restart
parent ControlKeys Remap
desc Which button will restart the game
MV Default: f5
default f5

param Console
parent ControlKeys Remap
desc Which button will open console during testing
MV Default: f8
default f8

tags input, keyboard
ライセンス表記
Terms of use:
https://github.com/quxios/QMV-Master-Demo/blob/master/readme.md

紹介ページ https://github.com/quxios/QMV-ABS-Demo/blob/master/js/plugins/QInput.js