how to check if a button is pressed?

like for example, show an image when Q is pressed
a parallel process with a number of waits to reduce lag and a conditional branch "if button pressed".

two problems:
1) doing it wrong will lag your game, and you didn't give enough details to tell you how many waits would be best.
2) this only works with the official keys/buttons, for full keyboard you'll need to use scripts/plugins.
a parallel process with a number of waits to reduce lag and a conditional branch "if button pressed".

two problems:
1) doing it wrong will lag your game, and you didn't give enough details to tell you how many waits would be best.
2) this only works with the official keys/buttons, for full keyboard you'll need to use scripts/plugins.
im using dk full keyboard plugin, do you know what scripts/plugins to use?
that plugin should be enough if it contains the correct commands to use the script part of conditional branch in the same way as the regular button pressed option
By default Q/W map to page up/down respectively, which can be checked via the built-in Conditional Branch -> Button options, e.g.

◆Comment:Check input~ ◆If:Button [Pageup] is pressed down ◆Text:None, Window, Bottom : :"Page Up" (Q, PageUp, or gamepad LB) pressed! ◆Comment:Remove until player leaves this map. ◆Erase Event ◆ :End ◆Comment:Check again next frame. ◆Wait:1 frame
For buttons not included in the default keymapper (i.e. added by a plugin), you'll need to use a scripted condition instead, e.g. Conditional Branch -> Script:
JavaScript:
Input.isPressed("A")
In this case "A" is the button name. DK Full Input lets you define names for each key in the Plugin Manager. As noted in the plugin's help, it also adds some new script calls for checking input.

For more context on how to respond to input, maybe check out this tutorial for Quick Time Events:
By default Q/W map to page up/down respectively, which can be checked via the built-in Conditional Branch -> Button options, e.g.

◆Comment:Check input~ ◆If:Button [Pageup] is pressed down ◆Text:None, Window, Bottom : :"Page Up" (Q, PageUp, or gamepad LB) pressed! ◆Comment:Remove until player leaves this map. ◆Erase Event ◆ :End ◆Comment:Check again next frame. ◆Wait:1 frame

For buttons not included in the default keymapper (i.e. added by a plugin), you'll need to use a scripted condition instead, e.g. Conditional Branch -> Script:
JavaScript:
Input.isPressed("A")
In this case "A" is the button name. DK Full Input lets you define names for each key in the Plugin Manager. As noted in the plugin's help, it also adds some new script calls for checking input.

For more context on how to respond to input, maybe check out this tutorial for Quick Time Events:
sorry for the late reply, but both scripts dont work for me?
1648304104388.png

please tell me what ive been doing wrong
sorry for the late reply, but both scripts dont work for me?
View attachment 221051
please tell me what ive been doing wrong
Where have you put this? We need to see the entire event.
Where have you put this? We need to see the entire
1648305042159.png
.
The common event has a trigger of none, which is what I thought would happen. It's not being called, which is why it's not doing anything.
Yes, you need to set the Trigger to Parallel, or else it would wait for an event to call it to run it (which is what the Call Common Event command in the event commands is for)
Yes, you need to set the Trigger to Parallel, or else it would wait for an event to call it to run it (which is what the Call Common Event command in the event commands is for)
Pre-empting a potential point of confusion following this: when you make a common event parallel process, you need to choose an activation switch for it and you need to turn that switch ON in an event when you want the event to start running (usually at the beginning) for it to start.
ok so im going insane
ive tried everything and it still wont work
ive turned on switches and still nothing
ive tried it on a new game and still nothing
im convinced my copy of this game is cursed
ok so im going insane
ive tried everything and it still wont work
ive turned on switches and still nothing
Screenshot what you've tried to do, please?
this is on a new game, no plugins
1648309932979.png
1648309968746.png

after i interact with the event, when i press z nothing occurs
this is on a new game, no plugins
View attachment 221061View attachment 221062
after i interact with the event, when i press z nothing occurs
Amusingly you have the same problem as before: the event that turns on the switch only does anything if you interact with it, which you can't do because it's below characters and has no graphic.
@THMG but have you defined the button Z as you were told several posts ago?

Script:
JavaScript:
Input.isPressed("A")
In this case "A" is the button name. DK Full Input lets you define names for each key in the Plugin Manager. As noted in the plugin's help, it also adds some new script calls for checking input.

Your command is asking if the BUTTON named Z is pressed - that has nothing to do with the key z on your keyboard.
You need to define the button AND assign it the key z in the plugin before anything can happen.

and that is assuming you really triggered the map event: always give the map events you need to trigger a sprite so that you can find it on the map.
sorry for the late reply, but both scripts dont work for me?
View attachment 221051
please tell me what ive been doing wrong
Key names are case-sensitive: try Input.isPressed("q") instead.

Normally it would be Input.isPressed("pageup") (or just the built-in "Page Up is Pressed" condition), but the default setup for DK_FullInput remaps key code 81 (Q) as q. (You can customise the plugin's key names via the Plugin Manager.)

Original thread: https://forums.rpgmakerweb.com/threads/how-to-check-if-a-button-is-pressed.146133/