Skip to content

Input fix for capitalized letters and > #14

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions input_handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def handle_keys(key, game_state):


def handle_player_turn_keys(key):
key_char = chr(key.c)
key_char = key.text

# Movement keys
if key.vk == libtcod.KEY_UP or key_char == 'k':
Expand Down Expand Up @@ -52,7 +52,7 @@ def handle_player_turn_keys(key):
elif key_char == 'd':
return {'drop_inventory': True}

elif key.vk == libtcod.KEY_ENTER:
elif key_char == '>':
return {'take_stairs': True}

elif key_char == 'c':
Expand All @@ -77,7 +77,7 @@ def handle_targeting_keys(key):


def handle_player_dead_keys(key):
key_char = chr(key.c)
key_char = key.text

if key_char == 'i':
return {'show_inventory': True}
Expand Down Expand Up @@ -109,7 +109,7 @@ def handle_inventory_keys(key):


def handle_main_menu(key):
key_char = chr(key.c)
key_char = key.text

if key_char == 'a':
return {'new_game': True}
Expand All @@ -123,7 +123,7 @@ def handle_main_menu(key):

def handle_level_up_menu(key):
if key:
key_char = chr(key.c)
key_char = key.text

if key_char == 'a':
return {'level_up': 'hp'}
Expand Down