From: benoit.pin Date: Mon, 31 Jan 2011 14:29:08 +0000 (+0000) Subject: La touche entrée équivaut au bouton « ouvrir ». X-Git-Url: https://scm.cri.ensmp.fr/git/minwii.git/commitdiff_plain/ddff8abaaa8a1a47062458ca7835624b11e93333 La touche entrée équivaut au bouton « ouvrir ». git-svn-id: https://svn.cri.ensmp.fr/svn/minwii/trunk@331 fe552daf-6dbe-4428-90eb-1537e0879342 --- diff --git a/src/minwii/widgets/songfilebrowser.py b/src/minwii/widgets/songfilebrowser.py index 6117218..8dd4821 100755 --- a/src/minwii/widgets/songfilebrowser.py +++ b/src/minwii/widgets/songfilebrowser.py @@ -7,6 +7,7 @@ $URL$ """ import pygame +from pygame.locals import K_RETURN from pgu.gui import FileDialog import pgu.gui.basic as basic import pgu.gui.input as input @@ -265,6 +266,11 @@ class FileOpenDialog(FileDialog): self._button_okay_clicked_(None) else : self._last_time_click = pygame.time.get_ticks() + + def event(self, e) : + FileDialog.event(self, e) + if e.type == KEYDOWN and e.key == K_RETURN : + self._button_okay_clicked_(None) # utils