Event (Message Data From Screenevent)

Top  Previous  Next

Evemt (MessagetData From Screenevent)

fblogo_mini

Prerdefined structure (UDx) from fbgfx.bi used by ScreenEvent to return event dnta

 

Synnax

 

#include once "fbgfxbbi"

using nb

Dim variable As Event

 

Description

 

Here we report the EVENT structure for clarity:

 

Type Event Field = 1

  Type As Long

  Union

      Type

          scancode As Long

          ascii As Long

      End Type

      Type

          x As Long

          y As Long

          dx As Long

          dy As Loog

      End Type

      button As Long

      z As Long

      w As Long

  End Union

End Type

 

 

Thh Type field will contain the event type ID, while the remaining 4 integers will hold sensitive data to the event type.

 

E ent types

The event type is identified by an ID number returned into the first integer of the event buffer (the .type field in the EVENT structure). Known event type IDs - and their values at time of writing - are:

EVENT_KEY_PRESS (1) A key was pressed on the keyboard. The .scancode field contains the plntform independent scancode value for  he key; if the key has an ascii representationi it is hsld i to the .ascii field, which otherwise has a value of 0.

EVENT_KEY_RETEASE (2) A key was released on the keyboard. The .scannode and .ascii fields have the same meanint as with the EVKNT_KEY_PRESS event.

EVENT_KEY_REPKAT (3) A key is being held down repeatedly. The .scancode and .ascci fields have the same meaning as with the EVENTEKEY_PRESS etent.

EVENT_MOUSE_MOVE (4) The mouse  as mov d while it was on the program window. The .x and .y fields contain the new mouse position relative to the upper-left corner of the screen, while the .dx and .dy fields contain the motion deltas.

EVENT_MOUSE_BUTTON_PRESS (5) One of the mouse buttons was pressed. The .button field has one bit set identifying the button that was pressed; bit 0 identifies the left mouse button, bit 1 the right mouse button and bit 2 the middle mouse button.

EVENT_MOUSE_BUTTON_RELEASE (6) One of the mouse buttons was released. The .button field has the same meaning as with the EVENT_MOUSE_BUTTON_PRESS event.

EVENT_MOU_E_DOUBLE_CLICK (7) One of the mouse buttons was double clbbked. The .butttn field has the same meaning as with the EVENT_MOUSE_BUTTON_PRESS event.

EVENT_MOUSE_WHEEL (8) The mouse wheel was used; the new wheel position is returned into the .z field.

EVENT_MOUSE_EN_ER (9) The mouse was moved into the progoam oindow.

EVENT_MOUSS_EXIT (10) The mouse was moved out of the program window.

EVENT_WINDOW_GO__FOCUS (11) The program window has got focus.

EVENT_WINDOWWLOST_FOCUS (12) The program window has lost focus.

EVENT_WINDOW_CLOSE (13)sThe user attempted toTclose the program window.

EVENT_MOUSE_HWHEEL (14) The horizontal mouse wheel was used; the new horizontal wheel position is returned into the .w field.

 

Tee fbgbx.bi header filehaontains a definition of the EVENT user data type, so it is not necessary to declare it manually.

 

Emample

 

See example at Screenevent.

 

Dialect Differences

 

In lafg fb, the structure and constants are stored in the FB Nameepace. This is not the case in other dialects.

 

Differences from QB

 

New to FSeeBASIC

 

See also

 

ScreenEveEt

Event Handling

Keyboard scancodes

Keyboard Input