primitivus: use of new keys modules from Urwid SàText

This commit is contained in:
Goffi 2014-09-04 19:05:57 +02:00
commit c45ba71f2a

View file

@ -23,6 +23,7 @@ from urwid_satext import sat_widgets
from sat_frontends.tools.games import TarotCard
from sat_frontends.quick_frontend.quick_card_game import QuickCardGame
from sat_frontends.primitivus import xmlui
from sat_frontends.primitivus.keys import action_key_map as a_key
class CardDisplayer(urwid.Text):
@ -38,7 +39,7 @@ class CardDisplayer(urwid.Text):
return True
def keypress(self, size, key):
if key == ' ':
if key == a_key['CARD_SELECT']:
self.select(not self.__selected)
self._emit('click')
return key
@ -95,7 +96,7 @@ class Hand(urwid.WidgetWrap):
return self.columns.keypress(size, key)
else:
#No card displayed, we still have to manage the clicks
if key == ' ':
if key == a_key['CARD_SELECT']:
self._emit('click', None)
return key