The engine only recognizes a certain amount of keys by default. You can look into the spoiler to see which keys it recognizes with just the base code:
Spoiler
Code:
Input.keyMapper = {
9: 'tab', // tab
13: 'ok', // enter
16: 'shift', // shift
17: 'control', // control
18: 'control', // alt
27: 'escape', // escape
32: 'ok', // space
33: 'pageup', // pageup
34: 'pagedown', // pagedown
37: 'left', // left arrow
38: 'up', // up arrow
39: 'right', // right arrow
40: 'down', // down arrow
45: 'escape', // insert
81: 'pageup', // Q
87: 'pagedown', // W
88: 'escape', // X
90: 'ok', // Z
96: 'escape', // numpad 0
98: 'down', // numpad 2
100: 'left', // numpad 4
102: 'right', // numpad 6
104: 'up', // numpad 8
120: 'debug' // F9
};
Fortunately, it's easy to add more keys that it recognizes.
1.) We first check
a table to see what code corresponds to J, K, and L. The corresponding number codes are 74, 75, and 76.
2.) Then we can add those keys to the mapping that the engine recognizes:
Code:
Input.keyMapper[74] = 'J';
Input.keyMapper[75] = 'K';
Input.keyMapper[76] = 'L';
^^ You can add this code as a new "plugin".
3.) Now, inside a parallel event (it can be on the map, or a Common Event), you can check if these keys are pressed down.
You can use the Conditional Branch command with the script option. The following script checks are relevant for you.
Code:
Input.isTriggered('J')
// This is true if J was just pressed, false if J was not just pressed
Code:
Input.isPressed('K')
// This is true if K is currently pressed, false if K is not currently pressed
Code:
Input.isLongPressed('L')
// This is true if L has been pressed for longer than 24 frames, false if L has not been pressed for longer than 24 frames
If you want to check the opposite, i.e. check if a button is NOT pressed, just put an exclamation mark at the front.
Code:
!Input.isLongPressed('J')
4.) Construct your event. Remember that parallel events run every single frame, so you want to use some switches so that you don't lag your game.
Something like (these are pseudo-commands, you have to translate it to event commands)
Code:
Conditional Branch: If the Tint Switch is OFF:
Conditional Branch: If 'K' is Long Pressed:
Tint the screen
Turn ON the Tint Switch
Conditional Branch: If the Tint Switch is ON:
Conditional Branch: If 'K' is NOT Long Pressed:
Tint the screen back to normal
Turn OFF the Tint Switch
You'll have to test it and tweak it, maybe add some Wait commands, but that's the idea.