Questions about using Input.keyMapper

@bass2yang I tried 61 for = and 173 for - based on the website I included above.

What is the code above supposed to be doing? I only recognize a couple of things from it.

If it is just to get to use the - and/or = key, those keys really aren't that important to me. I was just sort of curious that they didn't work like the rest of the keys I mapped.
Ah, the equal key is probably different (i found it was either 61 or 187, I believe). It is different with Firefox (61). Just the way the key code is mapped I suppose.

The code I gave you just sets all the keys you wrote out. The .fromCharCode() function takes from the ASCII code which is similar but not the same as the JS key codes (65 is 'A' in ASCII but 'a' in JS, etc.).

The function I wrote out just puts everything you wrote into a couple of lines, that's all.
Ah, so that code could replace all the separate lines. I will give that a try separately and test it.

Thanks!
If anyone knows an easier, more efficient way to achieve the same results I would be very happy to learn how to do it!
Whenever I am using a parallel event/common event, I try to avoid any other types of loops unless I have to. For the most part, how your event is set up would work great for a single script call.

If I am using a bit more lines than usual in a script call, I rewrite it as a function (plugin) and call the function instead to help with performance, troubleshooting, debugging, and reading.

Feel free to use it and modify as you see fit.
Video:

Code:
Spoiler
JavaScript:
/* zombiePicture Notes:
    - Declare variables:
        str: string of input keys
        arr: picture X coordinates
        key: previous button triggered
        ix1:  index for string/array
        ix2: index for pictures
        scr:  reference to $gameScreen
        pic:  create an array for the first 5 entries
                of $gameScreen._pictures; filter out
                any empty (null/undefined) entries
    - Check if the player's input matches string in str
    - If picture ix2 (index) is present, delete it
    - If the length of the array of pictures is less than 1,
        show the specific picture
    - This prevents other pictures being shown (only 1 can
        be shown at a time and must be removed before any
        other pictures in that range can be shown)
    - Console log for testing only - please remove when ready
        to avoid performance hit with console.
*/
function zombiePicture() {
    const str = 'fprc',
          arr = [5, 170, 335, 500],
          key = Input._latestButton,
          ix1 = str.indexOf(key),
          ix2 = ix1 + 1,
          scr = $gameScreen,
          pic = scr._pictures.slice(0, 5).filter(x => x);
    if (Input.isTriggered(str[ix1])) {
        if (scr.picture(ix2)) {
            scr.erasePicture(ix2);
        }
        if (pic.length < 1) {
            scr.showPicture(ix2, `D${ix2}`, 0, arr[ix1], 0, 100, 100, 255, 0);
        }
        console.log(`Key: ${str[ix1]}, Picture: ${ix2} - ${!!scr.picture(ix2)}`);
    }
};

Photos:
Spoiler
s2.png

s3.png
I did not use a wait frame here because the timing is very important since it depends upon user input (a 1 wait frame caused some delay issues that didn't really pick up the key input properly) - if you want to use a higher frame wait, I would recommend changing Input.isTriggered() to Input.isPressed() with a wait frame of at least 6 frames.

Also, when key inputs are important on every frame, I usually defer it to an eventlistener instead and go from there. It is a bit more complicated to set up, though. I believe Poryg had a good tutorial on something like it.

In your case, you would rename `D${ix2}` to simply `${ix2}` since your pictures are named 1, 2, 3, and 4. Hope this helps!
@bass2yang Holy Crap! Thank you so much!

I don't understand everything in the code of the function, but I do understand some of it and I am going to try searching for some of the parts that I don't completely understand.

But I have plenty of time. I was just experimenting with this for my much longer term RPG project. As I figure out certain mechanics that I want to have, I conduct experiments to see different options for implementation.

It is so nice of you to take the time to write the function, put in the description, make the demo video, and also show how to call the function in MZ.

It will be great to experiment with this and dig into the JS code until I actually understand what each piece is doing.

Thanks again and if I can ever do anything for you, just let me know. Right now about the only skill I have is play testing and giving feedback, but I am always happy to help.

EDIT: Trying to add the actual plugin file for people to download if that helps and posting a video of the tutorial that I made in the hopes that it helps other people.

Original thread: https://forums.rpgmakerweb.com/threads/questions-about-using-input-keymapper.174276/