AG1992_keyMapper Not rated

apocalympsegaming1992

Allows users to add different keys to use in game.


Tags keys mapper key map use keyboard keys in-game assign events to happen on keypress

//========================================== //keyMapper.js //========================================== /: @plugindesc Allows users to add different keys to use in game. @author ApocGaming1992 @help To add another key in plugin manually: -Add whatever keyName you want to the bottom of let keys + : + keyValue which you can find on http://keycode.info/ after Z:90, (EXAMPLE: Z:90, HOME:36)//keyToAdd -Add name of key that you chose at the end of let keyStrings Array (EXAMPLE: 'Z', 'HOME')//keyName
-Copy the following: Input.keyMapper[keys.Z] = keyStrings[25]; that is in keyPresses function and add below it, then change [keys.Z] to [keys.HOME] and keyStrings[25] to keyStrings[26]; To add another key using In-Game Events://This is useful if you want game to let you use key during certain time -Create an parallel process event and go to scripts and add the following: keyMap.myKey = myKeyNumber //myKey would be your keyName(ex. HOME), myKeyNumber would be number for key retrieved from above website (ex. 36), keyStrings.push(myKey); (ex. 'HOME'), Input.keyMapper[keys.myKey] = keyStrings[26]; ======================================================================================================== This is a sample for you to add key using script on In-Game Events(Make sure to add ending semi-colons): ======================================================================================================== keyMap.HOME = 36; keyStrings.push('HOME'); Input.keyMapper(keys.HOME)='HOME';
========================================================================================================

  • This Plugin doesn't contain parameters.
    */

//==================================== //FUNCTION ASSIGNED TO ADD KEYMAPS vvv //==================================== function keyMap() { let keys = { A: 65, B: 66, C: 67, D: 68, E: 69, F: 70, G: 71, H: 72, I: 73, J: 74, K: 75, L: 76, M: 77, N: 78, O: 79, P: 80, Q: 81, R: 82, S: 83, T: 84, U: 85, V: 86, W: 87, X: 88, Y: 89, Z: 90, SPACE: 32, ZERO: 48, ONE: 49, TWO: 50, THREE: 51, FOUR: 52, FIVE: 53, SIX: 54, SEVEN: 55, EIGHT: 56, NINE: 57, NUM0: 96, NUM1: 97, NUM2: 98, NUM3: 99, NUM4: 100, NUM5: 101, NUM6: 102, NUM7: 103, NUM8: 104, NUM9: 105 } let keyStrings = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'SPACE', 'ZERO', 'ONE', 'TWO', 'THREE', 'FOUR', 'FIVE', 'SIX', 'SEVEN', 'EIGHT', 'NINE', 'NUM0', 'NUM1', 'NUM2', 'NUM3', 'NUM4', 'NUM5', 'NUM6', 'NUM7', 'NUM8', 'NUM9' ] let keyPresses = function() { Input.keyMapper[keys.A] = keyStrings[0]; Input.keyMapper[keys.B] = keyStrings[1]; Input.keyMapper[keys.C] = keyStrings[2]; Input.keyMapper[keys.D] = keyStrings[3]; Input.keyMapper[keys.E] = keyStrings[4]; Input.keyMapper[keys.F] = keyStrings[5]; Input.keyMapper[keys.G] = keyStrings[6]; Input.keyMapper[keys.H] = keyStrings[7]; Input.keyMapper[keys.I] = keyStrings[8]; Input.keyMapper[keys.J] = keyStrings[9]; Input.keyMapper[keys.K] = keyStrings[10]; Input.keyMapper[keys.L] = keyStrings[11]; Input.keyMapper[keys.M] = keyStrings[12]; Input.keyMapper[keys.N] = keyStrings[13]; Input.keyMapper[keys.O] = keyStrings[14]; Input.keyMapper[keys.P] = keyStrings[15]; Input.keyMapper[keys.Q] = keyStrings[16]; Input.keyMapper[keys.R] = keyStrings[17]; Input.keyMapper[keys.S] = keyStrings[18]; Input.keyMapper[keys.T] = keyStrings[19]; Input.keyMapper[keys.U] = keyStrings[20]; Input.keyMapper[keys.V] = keyStrings[21]; Input.keyMapper[keys.W] = keyStrings[22]; Input.keyMapper[keys.X] = keyStrings[23]; Input.keyMapper[keys.Y] = keyStrings[24]; Input.keyMapper[keys.Z] = keyStrings[25]; Input.keyMapper[keys.SPACE] = keyStrings[26]; Input.keyMapper[keys.ZERO] = keyStrings[27]; Input.keyMapper[keys.ONE] = keyStrings[28]; Input.keyMapper[keys.TWO] = keyStrings[29]; Input.keyMapper[keys.THREE] = keyStrings[30]; Input.keyMapper[keys.FOUR] = keyStrings[31]; Input.keyMapper[keys.FIVE] = keyStrings[32]; Input.keyMapper[keys.SIX] = keyStrings[33]; Input.keyMapper[keys.SEVEN] = keyStrings[34]; Input.keyMapper[keys.EIGHT] = keyStrings[35]; Input.keyMapper[keys.NINE] = keyStrings[36]; Input.keyMapper[keys.NUM0] = keyStrings[37]; Input.keyMapper[keys.NUM1] = keyStrings[38]; Input.keyMapper[keys.NUM2] = keyStrings[39]; Input.keyMapper[keys.NUM3] = keyStrings[40]; Input.keyMapper[keys.NUM4] = keyStrings[41]; Input.keyMapper[keys.NUM5] = keyStrings[42]; Input.keyMapper[keys.NUM6] = keyStrings[43]; Input.keyMapper[keys.NUM7] = keyStrings[44]; Input.keyMapper[keys.NUM8] = keyStrings[45]; Input.keyMapper[keys.NUM9] = keyStrings[46]; } keyPresses();

}

//===================================== //END OF FUNCTION //===================================== //===================================== //Processes Funtion every second(Hint: 1000 === 1 Second) setInterval(keyMap, 10); //In this case, it will check if button is pressed every 1/100th of a second and then do what the button says to do //===================================== //=====================================

Available versions
This version doesn't have plugin dependencies.
This version doesn't have plugin dependencies.

User reviews (0)


This plugin doesn't have any review.