comparison demos/shooter/scripts/common/eventlistenerbase.py @ 446:2046a1f2f5f2

Adding the shooter demo. This is still a work in progress.
author prock@33b003aa-7bff-0310-803a-e67f0ece8222
date Wed, 31 Mar 2010 15:40:00 +0000
parents
children c4168eb47a44
comparison
equal deleted inserted replaced
445:f855809822cf 446:2046a1f2f5f2
1 # -*- coding: utf-8 -*-
2
3 # ####################################################################
4 # Copyright (C) 2005-2009 by the FIFE team
5 # http://www.fifengine.de
6 # This file is part of FIFE.
7 #
8 # FIFE is free software; you can redistribute it and/or
9 # modify it under the terms of the GNU Lesser General Public
10 # License as published by the Free Software Foundation; either
11 # version 2.1 of the License, or (at your option) any later version.
12 #
13 # This library is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 # Lesser General Public License for more details.
17 #
18 # You should have received a copy of the GNU Lesser General Public
19 # License along with this library; if not, write to the
20 # Free Software Foundation, Inc.,
21 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
22 # ####################################################################
23
24 from fife import fife
25
26 class EventListenerBase(fife.IKeyListener, fife.ICommandListener, fife.IMouseListener, fife.ConsoleExecuter):
27 def __init__(self, engine, regKeys=False, regCmd=False, regMouse=False, regConsole=False, regWidget=False):
28 self.eventmanager = engine.getEventManager()
29
30 fife.IKeyListener.__init__(self)
31 if regKeys:
32 self.eventmanager.addKeyListener(self)
33 fife.ICommandListener.__init__(self)
34 if regCmd:
35 self.eventmanager.addCommandListener(self)
36 fife.IMouseListener.__init__(self)
37 if regMouse:
38 self.eventmanager.addMouseListener(self)
39 fife.ConsoleExecuter.__init__(self)
40 if regConsole:
41 engine.getGuiManager().getConsole().setConsoleExecuter(self)
42
43
44 def mousePressed(self, evt):
45 pass
46 def mouseReleased(self, evt):
47 pass
48 def mouseEntered(self, evt):
49 pass
50 def mouseExited(self, evt):
51 pass
52 def mouseClicked(self, evt):
53 pass
54 def mouseWheelMovedUp(self, evt):
55 pass
56 def mouseWheelMovedDown(self, evt):
57 pass
58 def mouseMoved(self, evt):
59 pass
60 def mouseDragged(self, evt):
61 pass
62 def keyPressed(self, evt):
63 pass
64 def keyReleased(self, evt):
65 pass
66 def onCommand(self, command):
67 pass
68 def onToolsClick(self):
69 print "No tools set up yet"
70 def onConsoleCommand(self, command):
71 pass
72 def onWidgetAction(self, evt):
73 pass