The button has an event, which is called "OnKeyPress". It works fine - I know the button must have the focus -, but how can I find out, which key is pressed?
The key table describes the key numbers for keyDown and keyUp events with a variable "key" (format WORD),
but how does this work with "OnKeyPress", because a button has no "keyDown" or "keyUp" events.
I know this from other basics but I tried it out, but every try gave an error.
How can I catch the type of the pressed key?
OnKeyPress question
OnKeyPress question
Yes, I found the answer by myself:
What I`m looking for works only in an edit control with the events:
? ? ? OnKeyDown ?: ?" Sub([edit,] key, shift). A sub-routine calls if a key is pressed."
? ? ? OnKeyUp ?: ?" Sub([edit,] key, shift). A sub-routine calls if a key is released."
What do we learn from this:
? ? ? ?If you have a problem read the Help - file more exactly !
The Help file of FNXBasic is not as perfect as it could be, but it does what it has to do.
?
What I`m looking for works only in an edit control with the events:
? ? ? OnKeyDown ?: ?" Sub([edit,] key, shift). A sub-routine calls if a key is pressed."
? ? ? OnKeyUp ?: ?" Sub([edit,] key, shift). A sub-routine calls if a key is released."
What do we learn from this:
? ? ? ?If you have a problem read the Help - file more exactly !
The Help file of FNXBasic is not as perfect as it could be, but it does what it has to do.
?
OnKeyPress question
I know this with object EDIT. But what about the object BUTTON? You did want use with BUTTON
this events, didn`t you?
PaPi
this events, didn`t you?
PaPi
OnKeyPress question
I think a button only can see if a key is pressed, but not which key. Is this right ?
OnKeyPress question
Hi you can detect which button is pressed, only the keys not the special keys.
object f as form
object b as button
onkeypress=kp
end object
end object
f.showmodal
sub kp(key as integer)
showmessage str$(key)
end sub
I hope this will help you out
best regards
object f as form
object b as button
onkeypress=kp
end object
end object
f.showmodal
sub kp(key as integer)
showmessage str$(key)
end sub
I hope this will help you out
best regards
OnKeyPress question
Many thanks, this helps a lot.
The Help file gives only the information:
"OnKeyPress: Sub([button]). A sub-routine calls if a key is pressed."
I looked for a "key" variable in the format "word" as described at the event "onkeydown" with the edit control.
I dont`expected an integer.
The help should give more infos.
The Help file gives only the information:
"OnKeyPress: Sub([button]). A sub-routine calls if a key is pressed."
I looked for a "key" variable in the format "word" as described at the event "onkeydown" with the edit control.
I dont`expected an integer.
The help should give more infos.