Revision history for KeyPgGetkey


Revision [21949]

Last edited on 2017-10-10 08:29:39 by fxm [Wording]
Additions:
WARNING: In graphics mode and depending on the key pressed, ## ** Getkey ** ## may not always return the exact same value as in console mode (for a non-extended key, the most significant bit of the ascii code byte may be propagated to the higher 3 bytes of the return value, such as a sign bit).
Deletions:
WARNING: In graphics mode and depending on the key pressed, ## ** Getkey ** ## may not always return the same exact value than in console mode (for a non-extended key, the most significant bit of the ascii code byte can be propagated to the higher 3 bytes of the return value, like a sign bit).


Revision [21943]

Edited on 2017-10-07 14:01:20 by fxm [Description and example updated to have compatibility with console mode and graphic mode]
Additions:
WARNING: In graphics mode and depending on the key pressed, ## ** Getkey ** ## may not always return the same exact value than in console mode (for a non-extended key, the most significant bit of the ascii code byte can be propagated to the higher 3 bytes of the return value, like a sign bit).
Deletions:
WARNING: In graphics mode and depending on the key pressed, ## ** Getkey ** ## may not always return the same exact value than in console mode (for a non-extended key, the most important bit of the ascii code byte may be extended to the upper 3 bytes of the return value as a sign bit).


Revision [21942]

Edited on 2017-10-07 13:44:26 by fxm [Updated description and example to have compatibility with console mode and graphics mode]
Additions:
For a compatible code of the 2 screen modes, see the example below.
Deletions:
For full compatibility, see the example below.


Revision [21941]

Edited on 2017-10-07 08:35:57 by fxm [Updated description and example to have compatibility with console mode and graphics mode]
Additions:
For extended keys (returning two characters), the extended code is returned in the first byte, and the regular code is returned in the second byte (the third and fourth bytes always being null at least in console mode).
WARNING: In graphics mode and depending on the key pressed, ## ** Getkey ** ## may not always return the same exact value than in console mode (for a non-extended key, the most important bit of the ascii code byte may be extended to the upper 3 bytes of the return value as a sign bit).
For full compatibility, see the example below.
Deletions:
For extended keys (returning two characters), the extended code is returned in the first byte, and the regular code is returned in the second byte (the third and forth bytes being always null in console mode).
WARNING: In graphics mode and depending on the key pressed, ##**Getkey**## does not always return the expected value as in console mode (for a non-extended key, the most significant bit of the ascii code byte may be extended across the high bytes of return value like a sign bit).
See example below.


Revision [21940]

Edited on 2017-10-07 04:25:06 by fxm [Updated description and example to have compatibility with console mode and graphics mode]
Additions:
For extended keys (returning two characters), the extended code is returned in the first byte, and the regular code is returned in the second byte (the third and forth bytes being always null in console mode).
WARNING: In graphics mode and depending on the key pressed, ##**Getkey**## does not always return the expected value as in console mode (for a non-extended key, the most significant bit of the ascii code byte may be extended across the high bytes of return value like a sign bit).
dim as long foo
print "regular code: " & (foo and &hff)
Deletions:
For extended keys (returning two characters), the extended code is returned in the first byte, and the regular code is returned in the second byte (the third and forth bytes being always null).
WARNING: In graphics mode and depending on the key pressed, ##**Getkey**## does not always return the expected value as in console mode.
dim as integer foo
print "regular code: " & (foo)


Revision [21939]

Edited on 2017-10-06 15:05:06 by fxm [Added warning if it is used in graphics mode]
Additions:
WARNING: In graphics mode and depending on the key pressed, ##**Getkey**## does not always return the expected value as in console mode.


Revision [21598]

Edited on 2016-10-10 10:25:02 by fxm [Clearer description on the Long returned]
Additions:
It returns the ascii code of the first key in the keyboard buffer. The key is removed from the buffer. If no key is present, ##**Getkey**## waits for it.
For extended keys (returning two characters), the extended code is returned in the first byte, and the regular code is returned in the second byte (the third and forth bytes being always null).
See example below.
Deletions:
It returns the ascii code of the first key in the keyboard buffer. The key is removed from the buffer. If no key is present, ##**Getkey**## waits for it. For extended keys (returning two characters), the extended code is returned in the first byte, and the regular code is returned in the second byte. (see example below)


Revision [20936]

Edited on 2016-03-13 01:54:38 by fxm [Formatting]

No Differences

Revision [20255]

Edited on 2016-02-10 16:00:55 by DkLwikki [Update link format]
Additions:
[[KeyPgDeclare|declare]] [[KeyPgFunction|function]] **Getkey** ( ) [[KeyPgAs|as]] [[KeyPgLong|long]]
For a keyword not stopping the program if no key is at the buffer see ##[[KeyPgInkey|Inkey]]## or ##[[KeyPgMultikey|Multikey]]##.
- Not available in the //[[CompilerOptlang|-lang qb]]// dialect unless referenced with the alias ##**""__Getkey""**##.
- ##[[KeyPgGetmouse|GetMouse]]##
- ##[[KeyPgInkey|Inkey]]##
- ##[[KeyPgInputnum|Input()]]##
- ##[[KeyPgMultikey|Multikey]]##
Deletions:
[[KeyPgDeclare declare]] [[KeyPgFunction function]] **Getkey** ( ) [[KeyPgAs as]] [[KeyPgLong long]]
For a keyword not stopping the program if no key is at the buffer see ##[[KeyPgInkey Inkey]]## or ##[[KeyPgMultikey Multikey]]##.
- Not available in the //[[CompilerOptlang -lang qb]]// dialect unless referenced with the alias ##**""__Getkey""**##.
- ##[[KeyPgGetmouse GetMouse]]##
- ##[[KeyPgInkey Inkey]]##
- ##[[KeyPgInputnum Input()]]##
- ##[[KeyPgMultikey Multikey]]##


Revision [17503]

Edited on 2015-04-01 11:54:29 by DkLwikki [integer => long]
Additions:
The value of the ascii code returned.
Deletions:
The ##[[KeyPgInteger Integer]]## value of the ascii code returned.


Revision [17502]

Edited on 2015-04-01 11:53:51 by DkLwikki [integer => long]
Additions:
[[KeyPgDeclare declare]] [[KeyPgFunction function]] **Getkey** ( ) [[KeyPgAs as]] [[KeyPgLong long]]
Deletions:
[[KeyPgDeclare declare]] [[KeyPgFunction function]] **Getkey** ( ) [[KeyPgAs as]] [[KeyPgInteger integer]]


Revision [15841]

Edited on 2012-01-25 15:19:36 by CountingPine [Formatting]
Additions:
The ##[[KeyPgInteger Integer]]## value of the ascii code returned.
Deletions:
The [[KeyPgInteger integer]] value of the ascii code returned.


Revision [14353]

Edited on 2009-08-29 21:54:24 by CountingPine [Remove CamelCase links in "New to FreeBASIC"]
Additions:
- New to ""FreeBASIC""
Deletions:
- New to FreeBASIC


Revision [14213]

Edited on 2009-08-15 11:21:28 by CountingPine [name case fixup]
Additions:
- ##[[KeyPgGetmouse GetMouse]]##
Deletions:
- ##[[KeyPgGetMouse GetMouse]]##


Revision [14138]

Edited on 2009-05-17 12:29:18 by KristopherWindsor [see also: getmouse]
Additions:
- ##[[KeyPgGetMouse GetMouse]]##


Revision [13133]

The oldest known version of this page was created on 2008-04-24 15:42:11 by JeffMarshall [see also: getmouse]
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki



sf.net phatcode