SkyTemple / py-desmume

Python Library and GUI for DeSmuME, the Nintendo DS emulator
GNU General Public License v3.0
25 stars 5 forks source link

Custom inputs not working #8

Closed sunburn19 closed 3 years ago

sunburn19 commented 3 years ago

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) `

theCapypara commented 3 years ago

Heya! Can you check this issue real quick and see if the steps we discussed there solve your issue?: https://github.com/SkyTemple/py-desmume/issues/5

sunburn19 commented 3 years ago

Yes, they did, thank you!