Index

Package: Input

Description

package Events.Input is

Classes

Key_Event (abstract)

type Key_Event is abstract new Event with private;

Ancestors:

Immediate Children:

Primitive operations:

Construct
Events.Construct (Inherited)
Objects.Adjust (Inherited)
Objects.Construct (Inherited)
Objects.Delete (Inherited)
Objects.Object_Read (Inherited)
Objects.Object_Write (Inherited)
To_String (overriding Events.To_String)
A notification of a keyboard-based event.

Key_Held_Event

type Key_Held_Event is new Key_Event with private;

Ancestors:

Primitive operations:

Construct (Inherited)
Events.Construct (Inherited)
Objects.Adjust (Inherited)
Objects.Construct (Inherited)
Objects.Delete (Inherited)
Objects.Object_Read (Inherited)
Objects.Object_Write (Inherited)
To_String (Inherited)
A notification that a key was held down for the key repeat rate delay.

Key_Press_Event

type Key_Press_Event is new Key_Event with private;

Ancestors:

Primitive operations:

Construct (Inherited)
Events.Construct (Inherited)
Objects.Adjust (Inherited)
Objects.Construct (Inherited)
Objects.Delete (Inherited)
Objects.Object_Read (Inherited)
Objects.Object_Write (Inherited)
To_String (Inherited)
A notification that a key was pressed.

Key_Release_Event

type Key_Release_Event is new Key_Event with private;

Ancestors:

Primitive operations:

Construct (Inherited)
Events.Construct (Inherited)
Objects.Adjust (Inherited)
Objects.Construct (Inherited)
Objects.Delete (Inherited)
Objects.Object_Read (Inherited)
Objects.Object_Write (Inherited)
To_String (Inherited)
A notification that a key was released.

Mouse_Event (abstract)

type Mouse_Event is abstract new Event with private;

Ancestors:

Immediate Children:

Primitive operations:

Construct
Events.Construct (Inherited)
Objects.Adjust (Inherited)
Objects.Construct (Inherited)
Objects.Delete (Inherited)
Objects.Object_Read (Inherited)
Objects.Object_Write (Inherited)
To_String (overriding Events.To_String)
A notification of a mouse-based event.

Mouse_Move_Event

type Mouse_Move_Event is new Mouse_Event with private;

Ancestors:

Primitive operations:

Construct (Inherited)
Events.Construct (Inherited)
Objects.Adjust (Inherited)
Objects.Construct (Inherited)
Objects.Delete (Inherited)
Objects.Object_Read (Inherited)
Objects.Object_Write (Inherited)
To_String (Inherited)
A notification that the mouse moved.

Mouse_Scroll_Event

type Mouse_Scroll_Event is new Mouse_Event with private;

Ancestors:

Primitive operations:

Construct
Construct (Inherited)
Events.Construct (Inherited)
Objects.Adjust (Inherited)
Objects.Construct (Inherited)
Objects.Delete (Inherited)
Objects.Object_Read (Inherited)
Objects.Object_Write (Inherited)
To_String (Inherited)
A notification that the mouse wheel was scrolled.

Mouse_Button_Event (abstract)

type Mouse_Button_Event is abstract new Mouse_Event with private;

Ancestors:

Immediate Children:

Primitive operations:

Construct (Inherited)
Construct
Events.Construct (Inherited)
Objects.Adjust (Inherited)
Objects.Construct (Inherited)
Objects.Delete (Inherited)
Objects.Object_Read (Inherited)
Objects.Object_Write (Inherited)
To_String (overriding To_String)
A notification of a mouse button-based event.

Mouse_Click_Event

type Mouse_Click_Event is new Mouse_Button_Event with private;

Ancestors:

Primitive operations:

Construct (Inherited)
Construct (Inherited)
Events.Construct (Inherited)
Objects.Adjust (Inherited)
Objects.Construct (Inherited)
Objects.Delete (Inherited)
Objects.Object_Read (Inherited)
Objects.Object_Write (Inherited)
To_String (Inherited)
A notification that a mouse button was clicked (pressed and released rapidly).

Mouse_Doubleclick_Event

type Mouse_Doubleclick_Event is new Mouse_Button_Event with private;

Ancestors:

Primitive operations:

Construct (Inherited)
Construct (Inherited)
Events.Construct (Inherited)
Objects.Adjust (Inherited)
Objects.Construct (Inherited)
Objects.Delete (Inherited)
Objects.Object_Read (Inherited)
Objects.Object_Write (Inherited)
To_String (Inherited)
A notification that a mouse button was double-clicked (clicked twice, rapidly).

Mouse_Held_Event

type Mouse_Held_Event is new Mouse_Button_Event with private;

Ancestors:

Primitive operations:

Construct (Inherited)
Construct (Inherited)
Events.Construct (Inherited)
Objects.Adjust (Inherited)
Objects.Construct (Inherited)
Objects.Delete (Inherited)
Objects.Object_Read (Inherited)
Objects.Object_Write (Inherited)
To_String (Inherited)
A notification that a mouse button was held down for the mouse button repeat rate delay.

Mouse_Press_Event

type Mouse_Press_Event is new Mouse_Button_Event with private;

Ancestors:

Primitive operations:

Construct (Inherited)
Construct (Inherited)
Events.Construct (Inherited)
Objects.Adjust (Inherited)
Objects.Construct (Inherited)
Objects.Delete (Inherited)
Objects.Object_Read (Inherited)
Objects.Object_Write (Inherited)
To_String (Inherited)
A notification that a mouse button was pressed.

Mouse_Release_Event

type Mouse_Release_Event is new Mouse_Button_Event with private;

Ancestors:

Primitive operations:

Construct (Inherited)
Construct (Inherited)
Events.Construct (Inherited)
Objects.Adjust (Inherited)
Objects.Construct (Inherited)
Objects.Delete (Inherited)
Objects.Object_Read (Inherited)
Objects.Object_Write (Inherited)
To_String (Inherited)
A notification that a mouse button was released.

Types

A_Key_Event

type A_Key_Event is access all Key_Event'Class;

A_Mouse_Event

type A_Mouse_Event is access all Mouse_Event'Class;

A_Mouse_Scroll_Event

type A_Mouse_Scroll_Event is access all Mouse_Scroll_Event'Class;

A_Mouse_Button_Event

type A_Mouse_Button_Event is access all Mouse_Button_Event'Class;

Constants & Global variables

KEY_HELD_ID (Events.Event_Id)

KEY_HELD_ID    : constant Event_Id := To_Event_Id( "Key_Held" );

KEY_PRESS_ID (Events.Event_Id)

KEY_PRESS_ID   : constant Event_Id := To_Event_Id( "Key_Press" );

KEY_RELEASE_ID (Events.Event_Id)

KEY_RELEASE_ID : constant Event_Id := To_Event_Id( "Key_Release" );

MOUSE_MOVE_ID (Events.Event_Id)

MOUSE_MOVE_ID : constant Event_Id := To_Event_Id( "Mouse_Move" );

MOUSE_SCROLL_ID (Events.Event_Id)

MOUSE_SCROLL_ID : constant Event_Id := To_Event_Id( "Mouse_Scroll" );

MOUSE_CLICK_ID (Events.Event_Id)

MOUSE_CLICK_ID       : constant Event_Id := To_Event_Id( "Mouse_Click" );

MOUSE_DOUBLECLICK_ID (Events.Event_Id)

MOUSE_DOUBLECLICK_ID : constant Event_Id := To_Event_Id( "Mouse_Doubleclick" );

MOUSE_HELD_ID (Events.Event_Id)

MOUSE_HELD_ID        : constant Event_Id := To_Event_Id( "Mouse_Held" );

MOUSE_PRESS_ID (Events.Event_Id)

MOUSE_PRESS_ID       : constant Event_Id := To_Event_Id( "Mouse_Press" );

MOUSE_RELEASE_ID (Events.Event_Id)

MOUSE_RELEASE_ID     : constant Event_Id := To_Event_Id( "Mouse_Release" );

Subprograms & Entries

Get_Char

function Get_Char
( this: not null access Key_Event'Class ) return Character;
Returns a character of the key involved, if it's a readable character. Check the result of Is_Readable first.

Get_Key

function Get_Key
( this: not null access Key_Event'Class ) return Positive;
Returns the Allegro key code of the key involved.

Get_Modifiers

procedure Get_Modifiers
( this: not null access Key_Event'Class;
modifiers: out Modifiers_Array );
Returns a boolean array of modifier keys that were pressed/not pressed at the time of the event.

No_Modifiers

function No_Modifiers
( this: not null access Key_Event'Class ) return Boolean;
Returns True if no modifier keys were pressed at the time of the event.

Only_Alt

function Only_Alt
( this: not null access Key_Event'Class ) return Boolean;
Returns True if the Alt key was the only pressed modifier at the time of the event.

Only_Ctrl

function Only_Ctrl
( this: not null access Key_Event'Class ) return Boolean;
Returns True if the Ctrl key was the only pressed modifier at the time of the event.

Only_Shift

function Only_Shift
( this: not null access Key_Event'Class ) return Boolean;
Returns True if the Shift key was the only pressed modifier at the time of the event.

Is_Readable

function Is_Readable
( this: not null access Key_Event'Class ) return Boolean;
Returns True if the key is a human readable character and not a control key. If this function returns False then the key is a control key of some kind.

Get_X

function Get_X
( this: not null access Mouse_Event'Class ) return Integer;
Returns the X location of the mouse at the time of the event.

Get_Y

function Get_Y
( this: not null access Mouse_Event'Class ) return Integer;
Returns the Y location of the mouse within the window at the time of the event.

Set_XY

procedure Set_XY
( this: not null access Mouse_Event'Class;
x, y: Integer );
Sets the location of the mouse at the time of the event. This can be called by an event handler to filter the mouse even location for later mouse event handlers, to make the event location relative to some widget.

Get_Amount

function Get_Amount
( this: not null access Mouse_Scroll_Event'Class ) return Integer;
Returns the amount that the mouse wheel was scrolled.

Get_Button

function Get_Button
( this: not null access Mouse_Button_Event'Class ) return Mouse_Button;
Returns the mouse button involved in the event.

Get_Modifiers

function Get_Modifiers
( this: not null access Mouse_Button_Event'Class ) return Modifiers_Array;
Returns a boolean array of keyboard modifiers that were pressed at the time of the event.

Queue_Key_Held

procedure Queue_Key_Held
( key: Positive;
modifiers: Modifiers_Array;
capslock: Boolean );
Queues a Key_Held_Event.

Queue_Key_Press

procedure Queue_Key_Press
( key: Positive;
modifiers: Modifiers_Array;
capslock: Boolean );
Queues a Key_Held_Event.

Queue_Key_Release

procedure Queue_Key_Release
( key: Positive;
modifiers: Modifiers_Array;
capslock: Boolean );
Queues a Key_Held_Event.

Queue_Mouse_Click

procedure Queue_Mouse_Click
( x, y: Integer;
btn: Mouse_Button );
Queues a Key_Held_Event.

Queue_Mouse_Doubleclick

procedure Queue_Mouse_Doubleclick
( x, y: Integer;
btn: Mouse_Button );
Queues a Key_Held_Event.

Queue_Mouse_Held

procedure Queue_Mouse_Held
( x, y: Integer;
btn: Mouse_Button );
Queues a Key_Held_Event.

Queue_Mouse_Move

procedure Queue_Mouse_Move
( x, y: Integer );
Queues a Key_Held_Event.

Queue_Mouse_Press

procedure Queue_Mouse_Press
( x, y: Integer;
btn: Mouse_Button;
modifiers: Modifiers_Array );

Queue_Mouse_Release

procedure Queue_Mouse_Release
( x, y: Integer;
btn: Mouse_Button );

Create_Mouse_Release

function Create_Mouse_Release
( x, y: Integer;
btn: Mouse_Button ) return A_Mouse_Button_Event;
Creates a Mouse_Release_Event instance without queueing it. This is used only for a special case in the Window widget. The event is never queued; it's passed directly to a handler procedure to simulate an event.

Queue_Mouse_Scroll

procedure Queue_Mouse_Scroll
( x, y, amount: Integer );