AGX Dynamics 2.38.0.2
Loading...
Searching...
No Matches
KeyEvent.h
Go to the documentation of this file.
1/*
2Copyright 2007-2024. Algoryx Simulation AB.
3
4All AGX source code, intellectual property, documentation, sample code,
5tutorials, scene files and technical white papers, are copyrighted, proprietary
6and confidential material of Algoryx Simulation AB. You may not download, read,
7store, distribute, publish, copy or otherwise disseminate, use or expose this
8material unless having a written signed agreement with Algoryx Simulation AB, or having been
9advised so by Algoryx Simulation AB for a time limited evaluation, or having purchased a
10valid commercial license from Algoryx Simulation AB.
11
12Algoryx Simulation AB disclaims all responsibilities for loss or damage caused
13from using this software, unless otherwise stated in written agreements with
14Algoryx Simulation AB.
15*/
16
17#ifndef AGXIO_KEYEVENT_H
18#define AGXIO_KEYEVENT_H
19
20
21#include <agxIO/Events.h>
22#include <agx/Object.h>
23#include <agx/Task.h>
24
25namespace agxIO
26{
29 {
30 public:
31 static KeyEvent *load(agx::TiXmlElement *eKey, agx::Device *device);
32 virtual void configure(agx::TiXmlElement *eKey) override;
33
34 public:
37
38 public:
39 KeyEvent(const agx::String& key, const agx::String& scope = "");
40
41 void addTrigger(agx::Task *task);
43
44 virtual void rebind() override;
45 virtual agx::Object *getResourceImpl(const agx::Path& path, agx::Model *model) override;
46 protected:
47 virtual ~KeyEvent();
48 void keyCallback(int key, agxIO::EventType type);
49
50 private:
51 agx::String m_scope;
52 InputEvent::CallbackType m_keyCallback;
53 agx::TaskRefVector m_tasks;
54 };
55
56}
57
58#endif /* _AGXIO_KEYEVENT_H_ */
#define AGX_DECLARE_POINTER_TYPES(type)
Definition Referenced.h:254
#define AGXCORE_EXPORT
Only use as member allocated variable.
Definition Value.h:285
KeyEvent(const agx::String &key, const agx::String &scope="")
void addTrigger(agx::Task *task)
virtual void configure(agx::TiXmlElement *eKey) override
void keyCallback(int key, agxIO::EventType type)
virtual void rebind() override
agxData::Val< bool > downState
Definition KeyEvent.h:35
void removeTrigger(agx::Task *task)
static KeyEvent * load(agx::TiXmlElement *eKey, agx::Device *device)
agxData::Val< bool > toggleState
Definition KeyEvent.h:36
virtual agx::Object * getResourceImpl(const agx::Path &path, agx::Model *model) override
virtual ~KeyEvent()
Templated callback with two arguments.
Definition Callback.h:140
An agx::Device is an abstract representation of a device on which data can be stored and processed.
Definition Device.h:58
A model is an abstract representation of the class of an agx::Object.
Definition Model.h:41
agx::Object is a refcounted object with a name.
Definition Object.h:59
Representation of a path, a list of name components.
Definition Path.h:33
A representation of a generic task.
Definition Task.h:58
The agxIO namespace contains classes for reading, writing and finding files.
Definition Material.h:42
EventType
Definition Events.h:38