Project Name: MakeHuman
Product Home Page: http://www.makehuman.org/
Code Home Page: https://bitbucket.org/MakeHuman/makehuman/
Authors: Marc Flerackers
Copyright(c): MakeHuman Team 2001-2015
Licensing: AGPL3 (http://www.makehuman.org/doc/node/the_makehuman_application.html)
This file is part of MakeHuman (www.makehuman.org).
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
Coding Standards: See http://www.makehuman.org/node/165
This module contains classes to allow an object to handle events.
Base event handler class. Derive from this class if an object needs to be able to have events attached to it. Currently only one event per event name can be attached. This is because we either allow a class method or a custom method to be attached as event handling method. Since the custom method replaces the class method, it is needed in some case to call the base class’s method from the event handling method.
There are 2 ways to attach handlers:
class Widget(View):
def onMouseDown(self, event):
#Handle event
widget = Widget()
@widget.mhEvent:
def onMouseDown(event):
#Handle event
Note that self is not passed to the handler in this case, which should not be a problem as you can just use the variable since you are creating a closure.
Contains information about a view focus/blur event
Parameters: |
|
---|
Contains information about a keyboard event.
Parameters: |
|
---|
Contains information about a mouse event.
Parameters: |
|
---|
Contains information about a mouse wheel event.
Parameters: | wheelDelta (int) – the amount and direction that the wheel was scrolled. |
---|
Contains information about a resize event
Parameters: |
|
---|