comparison src/parpg/common/listeners/event_listener.py @ 182:59c9ce2b8351

PARPG now works with, and needs Fife 0.3.3.
author KarstenBock@gmx.net
date Tue, 11 Oct 2011 14:47:37 +0200
parents 1fd2201f5c36
children
comparison
equal deleted inserted replaced
181:54c4277ed905 182:59c9ce2b8351
15 # You should have received a copy of the GNU General Public License 15 # You should have received a copy of the GNU General Public License
16 # along with PARPG. If not, see <http://www.gnu.org/licenses/>. 16 # along with PARPG. If not, see <http://www.gnu.org/licenses/>.
17 17
18 """This module contains the EventListener that receives events and distributes 18 """This module contains the EventListener that receives events and distributes
19 them to PARPG listeners""" 19 them to PARPG listeners"""
20 import logging
20 21
21 from fife import fife 22 from fife import fife
22 import logging 23 from fife.extensions import pychan
23 24
24 logger = logging.getLogger('event_listener') 25 logger = logging.getLogger('event_listener')
25 26
26 class EventListener(fife.IKeyListener, 27 class EventListener(fife.IKeyListener,
27 fife.ICommandListener, 28 fife.ICommandListener,
37 fife.ICommandListener.__init__(self) 38 fife.ICommandListener.__init__(self)
38 self.event_manager.addCommandListener(self) 39 self.event_manager.addCommandListener(self)
39 fife.IMouseListener.__init__(self) 40 fife.IMouseListener.__init__(self)
40 self.event_manager.addMouseListener(self) 41 self.event_manager.addMouseListener(self)
41 fife.ConsoleExecuter.__init__(self) 42 fife.ConsoleExecuter.__init__(self)
42 engine.getGuiManager().getConsole().setConsoleExecuter(self) 43 pychan.manager.hook.guimanager.getConsole().setConsoleExecuter(self)
43 44
44 self.listeners = {"Mouse" : [], 45 self.listeners = {"Mouse" : [],
45 "Key" : [], 46 "Key" : [],
46 "Command" : [], 47 "Command" : [],
47 "ConsoleCommand" : [], 48 "ConsoleCommand" : [],