Hi,
I made a simple script that opens a room and the custom input processing isn't working.
I've used the following code that is used in the documentation as a test run:
keym = keymask(Keys.KEY_A)
emu.input.keypad_add_key(keym)
emu.input.keypad_rm_key(keym)
I can see the values of emu.input.keypad_get() changing, as it does when I press a button on the keyboard, but the input isn't being shown in the game.
I am using python 3.8.7 and am on windows 7 (I also tried on a Windows 10 computer, and had the same problem)
this is my full code:
`from desmume.controls import keymask, Keys, add_key
from desmume.emulator import DeSmuME
import time
import desmume
window = emu.create_sdl_window()
i = 0
while not window.has_quit():
window.process_input()
x = str(emu.input.keypad_get())
emu.cycle()
window.draw()
i += 1
if i == 1000:
keym = keymask(Keys.KEY_A)
emu.input.keypad_add_key(keym)
print(emu.input.keypad_get())
window.process_input()
emu.cycle()
window.draw()
window.process_input()
emu.cycle()
window.draw()
emu.input.keypad_rm_key(keym)
print(emu.input.keypad_get())
img = emu.screenshot()
img.save("Image.png")
if x != "0":
print(x)
`
Hi, I made a simple script that opens a room and the custom input processing isn't working. I've used the following code that is used in the documentation as a test run: keym = keymask(Keys.KEY_A) emu.input.keypad_add_key(keym) emu.input.keypad_rm_key(keym) I can see the values of emu.input.keypad_get() changing, as it does when I press a button on the keyboard, but the input isn't being shown in the game. I am using python 3.8.7 and am on windows 7 (I also tried on a Windows 10 computer, and had the same problem) this is my full code: `from desmume.controls import keymask, Keys, add_key from desmume.emulator import DeSmuME import time import desmume
print(desmume.controls.key_names) emu = DeSmuME() emu.open("Pokemon Platinum.nds")
window = emu.create_sdl_window() i = 0 while not window.has_quit(): window.process_input() x = str(emu.input.keypad_get()) emu.cycle() window.draw() i += 1 if i == 1000: keym = keymask(Keys.KEY_A) emu.input.keypad_add_key(keym) print(emu.input.keypad_get()) window.process_input() emu.cycle() window.draw() window.process_input() emu.cycle() window.draw() emu.input.keypad_rm_key(keym) print(emu.input.keypad_get()) img = emu.screenshot() img.save("Image.png") if x != "0": print(x) `