Advertisement
Archeia

Zalerinian KeyMapper

Feb 19th, 2019
546
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*:
  2.  * @plugindesc This plugin lets you control the keys on the keyboard, and how they're mapped to the game.
  3.  *
  4.  * <pluginID ZE - Key Mapper>
  5.  * @author Zalerinian
  6.  *
  7.  * @param Tab
  8.  * @desc The mapping for the Tab key
  9.  * @default tab
  10.  *
  11.  * @param Backspace
  12.  * @desc The mapping for the backspace key
  13.  * @default backspace
  14.  *
  15.  * @param Enter
  16.  * @desc The mapping for the 'enter' or 'return' key
  17.  * @default ok
  18.  *
  19.  * @param Shift
  20.  * @desc The mapping for the 'shift' key
  21.  * @default shift
  22.  *
  23.  * @param Control
  24.  * @desc The mapping for the 'ctrl' or 'control' key
  25.  * @default control
  26.  *
  27.  * @param Alt
  28.  * @desc The mapping for the 'alt' key
  29.  * @default control
  30.  *
  31.  * @param Pause
  32.  * @desc The mapping for the 'pause' key
  33.  * @default pause
  34.  *
  35.  * @param Capslock
  36.  * @desc The mapping for the 'capslock' key
  37.  * @default caps
  38.  *
  39.  * @param Escape
  40.  * @desc The mapping for the 'escape' key
  41.  * @default escape
  42.  *
  43.  * @param Space
  44.  * @desc The mapping for the 'space' key
  45.  * @default ok
  46.  *
  47.  * @param Pageup
  48.  * @desc The mapping for the 'page up' key
  49.  * @default pageup
  50.  *
  51.  * @param Pagedown
  52.  * @desc The mapping for the 'page down' key
  53.  * @default pagedown
  54.  *
  55.  * @param Home
  56.  * @desc The mapping for the 'home' key
  57.  * @default home
  58.  *
  59.  * @param End
  60.  * @desc The mapping for the 'end' key
  61.  * @default end
  62.  *
  63.  * @param Left
  64.  * @desc The mapping for the left arrow
  65.  * @default left
  66.  *
  67.  * @param Up
  68.  * @desc The mapping for the 'up' arrow
  69.  * @default up
  70.  *
  71.  * @param Right
  72.  * @desc The mapping for the 'right' arrow
  73.  * @default right
  74.  *
  75.  * @param Down
  76.  * @desc The mapping for the 'down' arrow
  77.  * @default down
  78.  *
  79.  * @param Print Screen
  80.  * @desc The mapping for the 'Print Screen' key
  81.  * @default prntscrn
  82.  *
  83.  * @param Insert
  84.  * @desc The mapping for the 'insert' key
  85.  * @default escape
  86.  *
  87.  * @param Delete
  88.  * @desc The mapping for the 'delete' key
  89.  * @default delete
  90.  *
  91.  * @param 0
  92.  * @desc The mapping for the '0' key
  93.  * @default 0
  94.  *
  95.  * @param 1
  96.  * @desc The mapping for the '1' key
  97.  * @default 1
  98.  *
  99.  * @param 2
  100.  * @desc The mapping for the '2' key
  101.  * @default 2
  102.  *
  103.  * @param 3
  104.  * @desc The mapping for the '3' key
  105.  * @default 3
  106.  *
  107.  * @param 4
  108.  * @desc The mapping for the '4' key
  109.  * @default 4
  110.  *
  111.  * @param 5
  112.  * @desc The mapping for the '5' key
  113.  * @default 5
  114.  *
  115.  * @param 6
  116.  * @desc The mapping for the '6' key
  117.  * @default 6
  118.  *
  119.  * @param 7
  120.  * @desc The mapping for the '7' key
  121.  * @default 7
  122.  *
  123.  * @param 8
  124.  * @desc The mapping for the '8' key
  125.  * @default 8
  126.  *
  127.  * @param 9
  128.  * @desc The mapping for the '9' key
  129.  * @default 9
  130.  *
  131.  * @param A
  132.  * @desc The mapping for the 'a' key
  133.  * @default a
  134.  *
  135.  * @param B
  136.  * @desc The mapping for the 'b' key
  137.  * @default b
  138.  *
  139.  * @param C
  140.  * @desc The mapping for the 'c' key
  141.  * @default c
  142.  *
  143.  * @param D
  144.  * @desc The mapping for the 'd' key
  145.  * @default d
  146.  *
  147.  * @param E
  148.  * @desc The mapping for the 'e' key
  149.  * @default e
  150.  *
  151.  * @param F
  152.  * @desc The mapping for the 'f' key
  153.  * @default f
  154.  *
  155.  * @param G
  156.  * @desc The mapping for the 'g' key
  157.  * @default g
  158.  *
  159.  * @param H
  160.  * @desc The mapping for the 'h' key
  161.  * @default h
  162.  *
  163.  * @param I
  164.  * @desc The mapping for the 'i' key
  165.  * @default i
  166.  *
  167.  * @param J
  168.  * @desc The mapping for the 'j' key
  169.  * @default j
  170.  *
  171.  * @param K
  172.  * @desc The mapping for the 'k' key
  173.  * @default k
  174.  *
  175.  * @param L
  176.  * @desc The mapping for the 'l' key
  177.  * @default l
  178.  *
  179.  * @param M
  180.  * @desc The mapping for the 'm' key
  181.  * @default m
  182.  *
  183.  * @param N
  184.  * @desc The mapping for the 'n' key
  185.  * @default n
  186.  *
  187.  * @param O
  188.  * @desc The mapping for the 'o' key
  189.  * @default o
  190.  *
  191.  * @param P
  192.  * @desc The mapping for the 'p' key
  193.  * @default p
  194.  *
  195.  * @param Q
  196.  * @desc The mapping for the 'q' key
  197.  * @default pageup
  198.  *
  199.  * @param R
  200.  * @desc The mapping for the 'r' key
  201.  * @default r
  202.  *
  203.  * @param S
  204.  * @desc The mapping for the 's' key
  205.  * @default s
  206.  *
  207.  * @param T
  208.  * @desc The mapping for the 't' key
  209.  * @default t
  210.  *
  211.  * @param U
  212.  * @desc The mapping for the 'u' key
  213.  * @default u
  214.  *
  215.  * @param V
  216.  * @desc The mapping for the 'v' key
  217.  * @default v
  218.  *
  219.  * @param W
  220.  * @desc The mapping for the 'w' key
  221.  * @default pagedown
  222.  *
  223.  * @param X
  224.  * @desc The mapping for the 'x' key
  225.  * @default escape
  226.  *
  227.  * @param Y
  228.  * @desc The mapping for the 'y' key
  229.  * @default y
  230.  *
  231.  * @param Z
  232.  * @desc The mapping for the 'z' key
  233.  * @default ok
  234.  *
  235.  * @param Semicolon
  236.  * @desc The mapping for the ';' key
  237.  * @default semicolon
  238.  *
  239.  * @param Equals
  240.  * @desc The mapping for the '=' key
  241.  * @default equals
  242.  *
  243.  * @param Minus
  244.  * @desc The mapping for the '-' key
  245.  * @default minus
  246.  *
  247.  * @param Super
  248.  * @desc The mapping for the 'windows' or 'command' key
  249.  * @default super
  250.  *
  251.  * @param Media
  252.  * @desc The mapping for the 'media' key
  253.  * @default media
  254.  *
  255.  * @param Num0
  256.  * @desc The mapping for 0 with numlock on
  257.  * @default num0
  258.  *
  259.  * @param Num1
  260.  * @desc The mapping for 1 with numlock on
  261.  * @default num1
  262.  *
  263.  * @param Num2
  264.  * @desc The mapping for 2 with numlock is on.
  265.  * @default down
  266.  *
  267.  * @param Num3
  268.  * @desc The mapping for 3 with numlock on
  269.  * @default num3
  270.  *
  271.  * @param Num4
  272.  * @desc The mapping for 4 with numlock is on.
  273.  * @default left
  274.  *
  275.  * @param Num5
  276.  * @desc The mapping for 5 with numlock on
  277.  * @default num5
  278.  *
  279.  * @param Num6
  280.  * @desc The mapping for 6 with numlock is on.
  281.  * @default right
  282.  *
  283.  * @param Num7
  284.  * @desc The mapping for 7 with numlock on
  285.  * @default num7
  286.  *
  287.  * @param Num8
  288.  * @desc The mapping for 8 with numlock is on.
  289.  * @default up
  290.  *
  291.  * @param Num9
  292.  * @desc The mapping for 9 with numlock on.
  293.  * @default num9
  294.  *
  295.  * @param Num*
  296.  * @desc The mapping for * on the number pad.
  297.  * @default multiply
  298.  *
  299.  * @param Num+
  300.  * @desc The mapping for + on the number pad.
  301.  * @default add
  302.  *
  303.  * @param Num-
  304.  * @desc The mapping for - on the number pad.
  305.  * @default subtract
  306.  *
  307.  * @param Num.
  308.  * @desc The mapping for . on the number pad.
  309.  * @default decimal
  310.  *
  311.  * @param Num/
  312.  * @desc The mapping for / on the number pad.
  313.  * @default divide
  314.  *
  315.  * @param F1
  316.  * @desc The mapping for the 'F1' key
  317.  * @default F1
  318.  *
  319.  * @param F2
  320.  * @desc The mapping for the 'F2' key
  321.  * @default F2
  322.  *
  323.  * @param F3
  324.  * @desc The mapping for the 'F3' key
  325.  * @default F3
  326.  *
  327.  * @param F4
  328.  * @desc The mapping for the 'F4' key
  329.  * @default F4
  330.  *
  331.  * @param F5
  332.  * @desc The mapping for the 'F5' key
  333.  * @default F5
  334.  *
  335.  * @param F6
  336.  * @desc The mapping for the 'F6' key
  337.  * @default F6
  338.  *
  339.  * @param F7
  340.  * @desc The mapping for the 'F7' key
  341.  * @default F7
  342.  *
  343.  * @param F8
  344.  * @desc The mapping for the 'F8' key
  345.  * @default F8
  346.  *
  347.  * @param F9
  348.  * @desc The mapping for the 'F9' key
  349.  * @default debug
  350.  *
  351.  * @param F10
  352.  * @desc The mapping for the 'F10' key
  353.  * @default F10
  354.  *
  355.  * @param F11
  356.  * @desc The mapping for the 'F11' key
  357.  * @default F11
  358.  *
  359.  * @param F12
  360.  * @desc The mapping for the 'F12' key
  361.  * @default F12
  362.  *
  363.  * @param Numlock
  364.  * @desc The mapping for the 'numlock' key
  365.  * @default numlock
  366.  *
  367.  * @param Scroll Lock
  368.  * @desc The mapping for the 'scroll lock' key
  369.  * @default scrollock
  370.  *
  371.  * @param Comma
  372.  * @desc The mapping for the 'comma' key
  373.  * @default comma
  374.  *
  375.  * @param Period
  376.  * @desc The mapping for the 'period' key
  377.  * @default period
  378.  *
  379.  * @param Slash
  380.  * @desc The mapping for the 'slash' key
  381.  * @default slash
  382.  *
  383.  * @param Backtick
  384.  * @desc The mapping for the 'backtick' key
  385.  * @default tilde
  386.  *
  387.  * @param Open Brace
  388.  * @desc The mapping for the '[' key
  389.  * @default [
  390.  *
  391.  * @param Backslash
  392.  * @desc The mapping for the '\' key
  393.  * @default \
  394.  *
  395.  * @param Closing Brace
  396.  * @desc The mapping for the ']' key
  397.  * @default ]
  398.  *
  399.  * @param Quote
  400.  * @desc The mapping for the ' key
  401.  * @default '
  402.  *
  403.  * @help
  404.  * To remap a key, simply find it in the parameter list, and double click to
  405.  * edit it. The values are the strings used in-game to check for input, and
  406.  * that are case-sensitive, so it's recommended to use all lower-case for
  407.  * the values.
  408.  *
  409.  * For movement, the values should be up, down, left, or right to move the
  410.  * player in the respective directions.
  411.  *
  412.  * 'ok' is used as the action button
  413.  *
  414.  * 'escape' is used as the cancel button.
  415.  *
  416.  * 'shift' is used for dashing.
  417.  *
  418.  */
  419.  
  420. (function(){
  421.   var params = PluginManager.parameters("ZE - Key Mapper");
  422.   Input.keyMapper = {
  423.     9:   params["Tab"          ],    // Tab
  424.     8:   params["Backspace"    ],    // Backspace
  425.     13:  params["Enter"        ],    // Enter
  426.     16:  params["Shift"        ],    // Shift
  427.     17:  params["Control"      ],    // Control
  428.     18:  params["Alt"          ],    // Alt
  429.     19:  params["Pause"        ],    // Media Pause
  430.     20:  params["Capslock"     ],    // Caps lock
  431.     27:  params["Escape"       ],    // Escape
  432.     32:  params["Space"        ],    // Space
  433.     33:  params["Pageup"       ],    // Page Up
  434.     34:  params["Pagedown"     ],    // Page Down
  435.     35:  params["Home"         ],    // Home
  436.     36:  params["End"          ],    // End
  437.     37:  params["Left"         ],    // Left Arrow
  438.     38:  params["Up"           ],    // Up Arrow
  439.     39:  params["Right"        ],    // Right Arrow
  440.     40:  params["Down"         ],    // Down Arrow
  441.     44:  params["Print"        ],    // Print Screen
  442.     45:  params["Insert"       ],    // Insert (numlock off)
  443.     46:  params["Delete"       ],    // Delete
  444.     48:  params["0"            ],    // 0
  445.     49:  params["1"            ],    // 1
  446.     50:  params["2"            ],    // 2
  447.     51:  params["3"            ],    // 3
  448.     52:  params["4"            ],    // 4
  449.     53:  params["5"            ],    // 5
  450.     54:  params["6"            ],    // 6
  451.     55:  params["7"            ],    // 7
  452.     56:  params["8"            ],    // 8
  453.     57:  params["9"            ],    // 9
  454.     65:  params["A"            ],    // A
  455.     66:  params["B"            ],    // B
  456.     67:  params["C"            ],    // C
  457.     68:  params["D"            ],    // D
  458.     69:  params["E"            ],    // E
  459.     70:  params["F"            ],    // F
  460.     71:  params["G"            ],    // G
  461.     72:  params["H"            ],    // H
  462.     73:  params["I"            ],    // I
  463.     74:  params["J"            ],    // J
  464.     75:  params["K"            ],    // K
  465.     76:  params["L"            ],    // L
  466.     77:  params["M"            ],    // M
  467.     78:  params["N"            ],    // N
  468.     79:  params["O"            ],    // O
  469.     80:  params["P"            ],    // P
  470.     81:  params["Q"            ],    // Q
  471.     82:  params["R"            ],    // R
  472.     83:  params["S"            ],    // S
  473.     84:  params["T"            ],    // T
  474.     85:  params["U"            ],    // U
  475.     86:  params["V"            ],    // V
  476.     87:  params["W"            ],    // W
  477.     88:  params["X"            ],    // X
  478.     89:  params["Y"            ],    // Y
  479.     90:  params["Z"            ],    // Z
  480.     91:  params["Super"        ],    // Windows key
  481.     93:  params["Media"        ],    // Windows Media key (?)
  482.     96:  params["Num0"         ],    // Numpad 0
  483.     97:  params["Num1"         ],    // Numpad 1
  484.     98:  params["Num2"         ],    // Numpad 2
  485.     99:  params["Num3"         ],    // Numpad 3
  486.     100: params["Num4"         ],    // Numpad 4
  487.     101: params["Num5"         ],    // Numpad 5
  488.     102: params["Num6"         ],    // Numpad 6
  489.     103: params["Num7"         ],    // Numpad 7
  490.     104: params["Num8"         ],    // Numpad 8
  491.     105: params["Num9"         ],    // Numpad 9
  492.     106: params["Num*"         ],    // Numpad * (Multiply)
  493.     107: params["Num+"         ],    // Numpad + (Add)
  494.     109: params["Num-"         ],    // Numpad - (Subtract)
  495.     110: params["Num."         ],    // Numpad . (Decimal)
  496.     111: params["Num/"         ],    // Numpad / (Divide)
  497.     112: params["F1"           ],    // F1
  498.     113: params["F2"           ],    // F2
  499.     114: params["F3"           ],    // F3
  500.     115: params["F4"           ],    // F4
  501.     116: params["F5"           ],    // F5
  502.     117: params["F6"           ],    // F6
  503.     118: params["F7"           ],    // F7
  504.     119: params["F8"           ],    // F8
  505.     120: params["F9"           ],    // F9
  506.     121: params["F10"          ],    // F10
  507.     122: params["F11"          ],    // F11
  508.     123: params["F12"          ],    // F12
  509.     144: params["Numlock"      ],    // Numlock
  510.     145: params["Scroll Lock"  ],    // Scroll lock
  511.     186: params["Semicolon"    ],    // Semicolon
  512.      59: params["Semicolon"    ],    // Semicolon - Firefox is being stupid.
  513.     187: params["Equals"       ],    // =
  514.      61: params["Equals"       ],    // = - Firefox is being stupid
  515.     188: params["Comma"        ],    // Comma
  516.     173: params["Minus"        ],    // -
  517.     189: params["Minus"        ],    // - Firefox is being stupid.
  518.     190: params["Period"       ],    // Period
  519.     191: params["Slash"        ],    // Slash
  520.     192: params["Backtick"     ],    // Backtick (A.K.A Grave, also the same key as the tilde on US keyboards)
  521.     219: params["Open Brace"   ],    // Open brace
  522.     220: params["Backslash"    ],    // Backslash
  523.     221: params["Closing Brace"],    // Closing brace
  524.     222: params["Quote"        ]     // Quote
  525.   };
  526. })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement