Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AskUserEventHandler for Inventory #44

Open
rinqtmith opened this issue Jan 12, 2021 · 0 comments
Open

AskUserEventHandler for Inventory #44

rinqtmith opened this issue Jan 12, 2021 · 0 comments

Comments

@rinqtmith
Copy link

I had to use shift+key (for example shift+a) to use and drop inventory items.
Issue was in repl.it.
I added tcod.event.K_MODE to ignored modifier keys to solve.

class AskUserEventHandler(EventHandler):
    """Handles user input for actions which require special input."""

    def ev_keydown(self, event: tcod.event.KeyDown) -> Optional[ActionOrHandler]:
        """By default any key exits this input handler."""
        if event.sym in {  # Ignore modifier keys.
            tcod.event.K_LSHIFT,
            tcod.event.K_RSHIFT,
            tcod.event.K_LCTRL,
            tcod.event.K_RCTRL,
            tcod.event.K_LALT,
            tcod.event.K_RALT,
        }:
            return None
        return self.on_exit()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant