Revision history for KeyPgScreenevent


Revision [21681]

Last edited on 2016-11-07 07:57:35 by fxm [Formatting]

No Differences

Revision [21121]

Edited on 2016-03-13 10:16:20 by fxm [Formatting]

No Differences

Revision [20502]

Edited on 2016-02-10 16:08:09 by DkLwikki [Update link format]
Additions:
[[KeyPgDeclare|declare]] [[KeyPgFunction|function]] **""ScreenEvent""** ( [[KeyPgByval|byval]] event [[KeyPgAs|as]] [[KeyPgAny|any]] [[KeyPgPtr|ptr]] = 0 ) [[KeyPgAs|as]] [[KeyPgLong|long]]
The event data (if available) will be copied into the buffer pointed That should be declared as an ##[[KeyPgEvent|Event]]##
The function returns ##-1## if there are pending events to be retrieved, ##0## otherwise. If the ##//event//## parameter is set to ##0## (the default if omitted) ##[[KeyPgScreenevent|ScreenEvent]]## will not be able to copy the event data and it will not dequeue it from the internal events queue. Calling the function this way can be useful to check if there are pending events without actually fetching them.
If you receive a KEY_PRESS, KEY_RELEASE or KEY_REPEAT event, it does not clear the keyboard buffer. If you need the buffer to be clear after you receive the event, you will need to clear it manually. See ##[[KeyPgInkey|Inkey]]##.
- Not available in the //[[CompilerOptlang|-lang qb]]// dialect.
- ##[[KeyPgEvent|Event]]##
- ##[[KeyPgScreengraphics|Screen (Graphics)]]##
- ##[[KeyPgInkey|Inkey]]##
- ##[[KeyPgMultikey|Multikey]]##
- ##[[KeyPgGetmouse|Getmouse]]##
Deletions:
[[KeyPgDeclare declare]] [[KeyPgFunction function]] **""ScreenEvent""** ( [[KeyPgByval byval]] event [[KeyPgAs as]] [[KeyPgAny any]] [[KeyPgPtr ptr]] = 0 ) [[KeyPgAs as]] [[KeyPgLong long]]
The event data (if available) will be copied into the buffer pointed That should be declared as an ##[[KeyPgEvent Event]]##
The function returns ##-1## if there are pending events to be retrieved, ##0## otherwise. If the ##//event//## parameter is set to ##0## (the default if omitted) ##[[KeyPgScreenevent ScreenEvent]]## will not be able to copy the event data and it will not dequeue it from the internal events queue. Calling the function this way can be useful to check if there are pending events without actually fetching them.
If you receive a KEY_PRESS, KEY_RELEASE or KEY_REPEAT event, it does not clear the keyboard buffer. If you need the buffer to be clear after you receive the event, you will need to clear it manually. See ##[[KeyPgInkey Inkey]]##.
- Not available in the //[[CompilerOptlang -lang qb]]// dialect.
- ##[[KeyPgEvent Event]]##
- ##[[KeyPgScreengraphics Screen (Graphics)]]##
- ##[[KeyPgInkey Inkey]]##
- ##[[KeyPgMultikey Multikey]]##
- ##[[KeyPgGetmouse Getmouse]]##


Revision [17542]

Edited on 2015-04-01 12:58:44 by DkLwikki [integer => long]
Additions:
[[KeyPgDeclare declare]] [[KeyPgFunction function]] **""ScreenEvent""** ( [[KeyPgByval byval]] event [[KeyPgAs as]] [[KeyPgAny any]] [[KeyPgPtr ptr]] = 0 ) [[KeyPgAs as]] [[KeyPgLong long]]
Deletions:
[[KeyPgDeclare declare]] [[KeyPgFunction function]] **""ScreenEvent""** ( [[KeyPgByval byval]] event [[KeyPgAs as]] [[KeyPgAny any]] [[KeyPgPtr ptr]] = 0 ) [[KeyPgAs as]] [[KeyPgInteger integer]]


Revision [15227]

Edited on 2011-09-26 15:10:36 by DkLwikki [Add EVENT_MOUSE_HWHEEL to example]
Additions:
case EVENT_MOUSE_HWHEEL
print "horizontal mouse wheel moved to position " & e.w


Revision [14583]

Edited on 2010-05-10 21:28:21 by ChA0s [Add sleep to teach nice manners.]
Additions:
sleep 1


Revision [14566]

Edited on 2010-01-24 17:05:30 by AntoniGual [Add sleep to teach nice manners.]
Additions:
The event data (if available) will be copied into the buffer pointed That should be declared as an ##[[KeyPgEvent Event]]##
- ##[[KeyPgEvent Event]]##
Deletions:
The event data (if available) will be copied into the buffer pointed to by the ##//event//## parameter; this buffer must currently be at least 5 ##[[KeyPgInteger Integer]]##s long (20 bytes). The first integer will contain the event type ID, while the remaining 4 integers will hold sensitive data to the event type. The ##fbgfx.bi## header file contains a definition of the ##EVENT## user data type, whose memory layout is compatible with the event data returned by this function; this can be used to ease the interpretation of the event data. Here we report the ##EVENT## structure for clarity:
{{fbdoc item="filename" value="examples/manual/check/KeyPgScreenevent_1.bas"}}%%(freebasic)
Type EVENT Field = 1
Type As Integer
Union
Type
scancode As Integer
ascii As Integer
End Type
Type
x As Integer
y As Integer
dx As Integer
dy As Integer
End Type
button As Integer
z As Integer
End Union
End Type
__Event 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 platform independent scancode value for the key; if the key has an ascii representation, it is held into the ##.ascii## field, which otherwise has a value of 0.
- ##EVENT_KEY_RELEASE## (##2##) A key was released on the keyboard. The ##.scancode## and ##.ascii## fields have the same meaning as with the ##EVENT_KEY_PRESS## event.
- ##EVENT_KEY_REPEAT## (##3##) A key is being held down repeatedly. The ##.scancode## and ##.ascii## fields have the same meaning as with the ##EVENT_KEY_PRESS## event.
- ##EVENT_MOUSE_MOVE## (##4##) The mouse was moved 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_MOUSE_DOUBLE_CLICK## (##7##) One of the mouse buttons was double clicked. The ##.button## 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_ENTER## (##9##) The mouse was moved into the program window.
- ##EVENT_MOUSE_EXIT## (##10##) The mouse was moved out of the program window.
- ##EVENT_WINDOW_GOT_FOCUS## (##11##) The program window has got focus.
- ##EVENT_WINDOW_LOST_FOCUS## (##12##) The program window has lost focus.
- ##EVENT_WINDOW_CLOSE## (##13##) The user attempted to close the program window.
In //[[CompilerDialects lang fb]]//, the structure and constants are stored in the ##FB## ##[[KeyPgNamespace Namespace]]##.


Revision [14144]

Edited on 2009-05-25 22:03:05 by ImOrtis [Added note about keyboard buffer needing to be cleared after retreving keyboard events.]
Additions:
In //[[CompilerDialects lang fb]]//, the structure and constants are stored in the ##FB## ##[[KeyPgNamespace Namespace]]##.
__Note__
If you receive a KEY_PRESS, KEY_RELEASE or KEY_REPEAT event, it does not clear the keyboard buffer. If you need the buffer to be clear after you receive the event, you will need to clear it manually. See ##[[KeyPgInkey Inkey]]##.
Deletions:
In //[[CompilerDialects lang fb]]//, the structure and constants are stored in th ##FB## ##[[KeyPgNamespace Namespace]]##.


Revision [13676]

Edited on 2008-09-01 20:03:46 by CountingPine [Mention FB namespace; misc edits]
Additions:
Returns ##-1## if there are pending events to be retrieved, ##0## otherwise.
This function returns the latest available system event from the internal ""GfxLib"" events queue. By "event" we mean any mouse or keyboard activity, for example.
The event data (if available) will be copied into the buffer pointed to by the ##//event//## parameter; this buffer must currently be at least 5 ##[[KeyPgInteger Integer]]##s long (20 bytes). The first integer will contain the event type ID, while the remaining 4 integers will hold sensitive data to the event type. The ##fbgfx.bi## header file contains a definition of the ##EVENT## user data type, whose memory layout is compatible with the event data returned by this function; this can be used to ease the interpretation of the event data. Here we report the ##EVENT## structure for clarity:
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 platform independent scancode value for the key; if the key has an ascii representation, it is held into the ##.ascii## field, which otherwise has a value of 0.
- ##EVENT_KEY_RELEASE## (##2##) A key was released on the keyboard. The ##.scancode## and ##.ascii## fields have the same meaning as with the ##EVENT_KEY_PRESS## event.
- ##EVENT_KEY_REPEAT## (##3##) A key is being held down repeatedly. The ##.scancode## and ##.ascii## fields have the same meaning as with the ##EVENT_KEY_PRESS## event.
- ##EVENT_MOUSE_MOVE## (##4##) The mouse was moved 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_MOUSE_DOUBLE_CLICK## (##7##) One of the mouse buttons was double clicked. The ##.button## 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_ENTER## (##9##) The mouse was moved into the program window.
- ##EVENT_MOUSE_EXIT## (##10##) The mouse was moved out of the program window.
- ##EVENT_WINDOW_GOT_FOCUS## (##11##) The program window has got focus.
- ##EVENT_WINDOW_LOST_FOCUS## (##12##) The program window has lost focus.
- ##EVENT_WINDOW_CLOSE## (##13##) The user attempted to close the program window.
In //[[CompilerDialects lang fb]]//, the structure and constants are stored in th ##FB## ##[[KeyPgNamespace Namespace]]##.

The function returns ##-1## if there are pending events to be retrieved, ##0## otherwise. If the ##//event//## parameter is set to ##0## (the default if omitted) ##[[KeyPgScreenevent ScreenEvent]]## will not be able to copy the event data and it will not dequeue it from the internal events queue. Calling the function this way can be useful to check if there are pending events without actually fetching them.
#if __FB_LANG__ = "fb"
using fb '' constants and structures are stored in the FB namespace in lang fb
#endif
- New to ""FreeBASIC""
- ##[[KeyPgInkey Inkey]]##
Deletions:
Returns -1 if there are pending events to be retrieved, 0 otherwise.
This function returns the latest available system event from the internal GfxLib events queue. By "event" we mean any mouse or keyboard activity for example.
The event data (if available) will be copied into the buffer pointed to by the ##//event//## parameter; this buffer must currently be at least 5 integers long (20 bytes). The first integer will contain the event type ID, while the remaining 4 integers will hold sensitive data to the event type. The fbgfx.bi header file contains a definition of the ##EVENT## user data type, whose memory layout is compatible with the event data returned by this function; this can be used to ease the interpretation of the event data. Here we report the ##EVENT## structure for clarity:
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 are:
- EVENT_KEY_PRESS (1) A key was pressed on the keyboard. The ##.scancode## field contains the platform independent scancode value for the key; if the key has an ascii representation, it is held into the ##.ascii## field, which otherwise has a value of 0.
- EVENT_KEY_RELEASE (2) A key was released on the keyboard. The ##.scancode## and ##.ascii## fields have the same meaning as with the EVENT_KEY_PRESS event.
- EVENT_KEY_REPEAT (3) A key is being held down repeatedly. The ##.scancode## and ##.ascii## fields have the same meaning as with the EVENT_KEY_PRESS event.
- EVENT_MOUSE_MOVE (4) The mouse was moved 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_MOUSE_DOUBLE_CLICK (7) One of the mouse buttons was double clicked. The ##.button## 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_ENTER (9) The mouse was moved into the program window.
- EVENT_MOUSE_EXIT (10) The mouse was moved out of the program window.
- EVENT_WINDOW_GOT_FOCUS (11) The program window has got focus.
- EVENT_WINDOW_LOST_FOCUS (12) The program window has lost focus.
- EVENT_WINDOW_CLOSE (13) The user attempted to close the program window.
The function returns -1 if there are pending events to be retrieved, 0 otherwise. If the ##//event//## parameter is set to 0 (the default if omitted) ##[[KeyPgScreenevent ScreenEvent]]## will not be able to copy the event data and it will not dequeue it from the internal events queue. Calling the function this way can be useful to check if there are pending events without actually fetching them.
using fb
- New to FreeBASIC


Revision [12433]

The oldest known version of this page was created on 2008-01-18 14:25:00 by JeffMarshall [Mention FB namespace; misc edits]
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki



sf.net phatcode