primitivus: use of new keys modules from Urwid SàText
This commit is contained in:
parent
acb499098f
commit
c45ba71f2a
1 changed files with 93 additions and 27 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue