![]() |
Gorgon Game Engine
|
This namespace contains general input related functionality. More...
Namespaces | |
internal | |
Keyboard | |
Keyboard related functions and enumerations. | |
Mouse | |
Classes | |
class | DragInfo |
Contains information about a drag operation. More... | |
class | DragSource |
class | DropTarget |
This layer acts as a drop target. More... | |
class | KeyRepeater |
This class simplifies the use of repeated keystrokes when a key is pressed. More... | |
class | Layer |
Input layer allows mouse events to be handled. More... | |
Typedefs | |
typedef int | Key |
A type to represent an input key. More... | |
Functions | |
void | begindrag () |
template<class ... A_> | |
DragInfo & | BeginDrag (A_ &&... data) |
Begins a drag operation using the given data, without a source. More... | |
void | begindrag (DragSource &source) |
template<class ... A_> | |
DragInfo & | BeginDrag (DragSource &source, A_ &&... data) |
Begins a drag operation using the given source and data. More... | |
void | CancelDrag () |
Cancel the current drag operation. More... | |
void | Drop (Geometry::Point location={0, 0}) |
Drop the current drag object. More... | |
void | finishdrag (bool success) |
DragInfo & | GetDragOperation () |
Returns the current drag operation, throws if IsDragPrepared is false. More... | |
void | initdrag () |
bool | IsDragging () |
Returns whether a drag operation is in progress. More... | |
bool | IsDragPrepared () |
Returns whether a drag operation is available. More... | |
bool | needsclip (Input::Mouse::EventType event) |
DragInfo & | PrepareDrag () |
Prepares the drag operation. More... | |
DragInfo & | PrepareDrag (DragSource &source) |
Prepares the drag operation. More... | |
void | startdrag () |
DragInfo & | StartDrag () |
Starts the drag operation. More... | |
Variables | |
bool | AllowCharEvent |
During keyevent this variable can be set to true, if done so, it will allow character events even if key event is handled. More... | |
Event< void, DragInfo &, bool > | DragEnded |
This event is fired whenever a drag operation ends. More... | |
DragInfo * | DragOperation |
Current Drag operation, could be nullptr, denoting there is none. More... | |
bool | dragstarted |
Event< void, DragInfo & > | DragStarted |
This event is fired whenever a drag operation begins. More... | |
This namespace contains general input related functionality.
Also check Gorgon::Keyboard and Gorgon::Mouse.
typedef int Key |
A type to represent an input key.
void Gorgon::Input::begindrag | ( | ) |
References DragOperation, and initdrag().
DragInfo& Gorgon::Input::BeginDrag | ( | A_ &&... | data | ) |
Begins a drag operation using the given data, without a source.
Data will be assigned immediately for events to work properly. Additional data items can be added later if additional data become available at a later time. It is not possible to receive any drag related events without a source.
References begindrag(), DragInfo::DataReady(), DragOperation, and startdrag().
void Gorgon::Input::begindrag | ( | DragSource & | source | ) |
References DragOperation, and initdrag().
DragInfo& Gorgon::Input::BeginDrag | ( | DragSource & | source, |
A_ &&... | data | ||
) |
Begins a drag operation using the given source and data.
Data will be assigned immediately for events to work properly. Additional data items can be added later if additional data become available at a later time.
References begindrag(), DragInfo::DataReady(), DragOperation, and startdrag().
void CancelDrag | ( | ) |
Cancel the current drag operation.
References finishdrag(), GetDragOperation(), and IsDragging().
void Drop | ( | Geometry::Point | location = {0, 0} | ) |
Drop the current drag object.
If there is no target receiving it, it will be canceled
References CancelDrag(), finishdrag(), GetDragOperation(), and IsDragging().
void Gorgon::Input::finishdrag | ( | bool | success | ) |
References DragEnded, DragOperation, dragstarted, GetDragOperation(), and IsDragging().
DragInfo& Gorgon::Input::GetDragOperation | ( | ) |
Returns the current drag operation, throws if IsDragPrepared is false.
References DragOperation.
void initdrag | ( | ) |
bool Gorgon::Input::IsDragging | ( | ) |
Returns whether a drag operation is in progress.
References DragOperation, and dragstarted.
bool Gorgon::Input::IsDragPrepared | ( | ) |
Returns whether a drag operation is available.
References DragOperation.
bool needsclip | ( | Input::Mouse::EventType | event | ) |
DragInfo& Gorgon::Input::PrepareDrag | ( | ) |
Prepares the drag operation.
This function does not fully start the drag operation. You should call StartDrag after setting the data of the drag object
References DragOperation, and initdrag().
DragInfo& Gorgon::Input::PrepareDrag | ( | DragSource & | source | ) |
Prepares the drag operation.
This function does not fully start the drag operation. You should call StartDrag after setting the data of the drag object
References DragOperation, and initdrag().
void Gorgon::Input::startdrag | ( | ) |
References ASSERT, DragOperation, dragstarted, DragStarted, and IsDragPrepared().
DragInfo& Gorgon::Input::StartDrag | ( | ) |
Starts the drag operation.
You should first call PrepareDrag and set the data before starting the drag operation.
References DragOperation, and startdrag().
bool AllowCharEvent |
During keyevent this variable can be set to true, if done so, it will allow character events even if key event is handled.
However, doing so will not direct the up event to the handler directly.
This event is fired whenever a drag operation ends.
Second parameter is set to true if the drag is accepted, if canceled it will be set to false. First parameter might not be reliable as this event is called after cancel/accept events.
DragInfo * DragOperation |
Current Drag operation, could be nullptr, denoting there is none.
It is better to use GetDragOperation function.
bool dragstarted |