in windowed mode, clicking on the window close button will add a keypress of Chr(255)&"k" to the Inkey buffer.
You must test it as a key in: do
getmouse x,y,,b
.....
loop until inkey = chr(255)&"k"
fxm wrote:in windowed mode, clicking on the window close button will add a keypress of Chr(255)&"k" to the Inkey buffer.
You must test it as a key in: do
getmouse x,y,,b
.....
loop until inkey = chr(255)&"k"
Yes, this is exactly what I need! ;-) Thanks!
What is "k" (or &"k" with chr$(255)) actually? And exists, for example, chr$ for key ENTER?
If the key is an "extended" one (numeric pad, cursors, functions, close button) a two-character String is returned, the first of which is the extended character:
Chr(255), except Chr(0) for QB dialect.
fxm wrote:If the key is an "extended" one (numeric pad, cursors, functions, close button) a two-character String is returned, the first of which is the extended character:
Chr(255), except Chr(0) for QB dialect.
The escape key is 27.
Also, for the close window button you could use Chr(255,107) instead of Chr(255)&"k". They both do the same thing.
Here is a little program I used to use to find key ID numbers. You might find it useful, just press random keys and see their IDs. Press Space to exit.
ScreenRes 320, 240
Dim As String key
Do
Sleep 16
key = InKey
While key <> ""
For i As Integer = 0 To (Len(key) - 1)
Print " " & key[i];
Next
Print
If key = " " Then Exit Do
key = InKey
Wend
Loop
pestery wrote:The escape key is 27.
Also, for the close window button you could use Chr(255,107) instead of Chr(255)&"k". They both do the same thing.
Here is a little program I used to use to find key ID numbers. You might find it useful, just press random keys and see their IDs. Press Space to exit.
ScreenRes 320, 240
Dim As String key
Do
Sleep 16
key = InKey
While key <> ""
For i As Integer = 0 To (Len(key) - 1)
Print " " & key[i];
Next
Print
If key = " " Then Exit Do
key = InKey
Wend
Loop