renpy icon indicating copy to clipboard operation
renpy copied to clipboard

repeat_ prefix does not work with gamepad buttons

Open javascript-error opened this issue 5 years ago • 0 comments

When using a gamepad button with the key screen statement and the repeat_ prefix attached, a crash occurs.

Example game:

label start:
    "Hello World"
    call screen test
    "Goodbye Space"

screen test():
    key 'repeat_pad_righttrigger_pos' action Return()
While running game code:
  File "game/script.rpy", line 29, in script
    call screen test
  File "renpy/common/000statements.rpy", line 569, in execute_call_screen
    store._return = renpy.call_screen(name, *args, **kwargs)
Exception: Invalid key specifier pad_righttrigger_pos

-- Full Traceback ------------------------------------------------------------

Full traceback:
  File "game/script.rpy", line 29, in script
    call screen test
  File "renpy/ast.py", line 2015, in execute
    self.call("execute")
  File "renpy/ast.py", line 2003, in call
    return renpy.statements.call(method, parsed, *args, **kwargs)
  File "renpy/statements.py", line 278, in call
    return method(parsed, *args, **kwargs)
  File "renpy/common/000statements.rpy", line 569, in execute_call_screen
    store._return = renpy.call_screen(name, *args, **kwargs)
  File "renpy/exports.py", line 3134, in call_screen
    rv = renpy.ui.interact(mouse="screen", type="screen", roll_forward=roll_forward)
  File "renpy/ui.py", line 298, in interact
    rv = renpy.game.interface.interact(roll_forward=roll_forward, **kwargs)
  File "renpy/display/core.py", line 3315, in interact
    repeat, rv = self.interact_core(preloads=preloads, trans_pause=trans_pause, pause=pause, pause_start=pause_start, **kwargs)
  File "renpy/display/core.py", line 4151, in interact_core
    rv = root_widget.event(ev, x, y, 0)
  File "renpy/display/layout.py", line 1100, in event
    rv = i.event(ev, x - xo, y - yo, cst)
  File "renpy/display/layout.py", line 1100, in event
    rv = i.event(ev, x - xo, y - yo, cst)
  File "renpy/display/layout.py", line 1100, in event
    rv = i.event(ev, x - xo, y - yo, cst)
  File "renpy/display/screen.py", line 727, in event
    rv = self.child.event(ev, x, y, st)
  File "renpy/display/layout.py", line 1100, in event
    rv = i.event(ev, x - xo, y - yo, cst)
  File "renpy/display/behavior.py", line 468, in event
    if map_event(ev, name):
  File "renpy/display/behavior.py", line 232, in map_event
    check_code = eval("lambda ev : " + compile_event(keysym, True), globals())
  File "renpy/display/behavior.py", line 148, in compile_event
    raise Exception("Invalid key specifier %s" % key)
Exception: Invalid key specifier pad_righttrigger_pos

javascript-error avatar Oct 26 '21 20:10 javascript-error