Le 11 avr. 06 à 19:25 Soir, Sven E Olsson a écrit:

Hi,

I have some problems with the Keyboard Module in the KeyDown event in an Editfield.

This code works properly...

  if Keyboard.OSKey = true then
    if key = Lowercase("r") then
      DoPreviewDocument()
      Return true
    end if
  end if

---------------------------------------------------------

This code is not working, the Keyboard.ControlKey is fired properly, but the 'Key' (from the KeyDown event) is blank.
Checked in the Debugger ( size 1 ASCII / but blank )
In the Keyboard.OsKey the 'Key' variable is shown properly in the Debugger.

  if Keyboard.ControlKey = true then
    if key = Lowercase("a") then
      JumpTwice()
      Return true
    end if
  end if

Any ideas about this?
Checked in RB2006r1/r2 OS X 10.4.6

Sven E

Using the control key is supposed to produce non printable characters (or beeps on some applications which prevent that). Control-a won't produce the "a" character (it's like when you type "option-p": you get a special character (here: "π"), but you only know that final character, not the "p" key)).

Here's how I do it (it was the only way on RB 5.5, but I don't think something has changed; I'm still on RB 5.5):
Function IsKeyDown(key As String) As Boolean
  dim i As integer

  for i=0 to 127
    if Keyboard.AsyncKeyDown(i) then
      if Keyboard.KeyName(i)=key then Return True
    end if
  Next
End Function

This won't works for special keys (delete, for example) since the produced characters won't be "delete", obviously ;-)
Hope this helps._______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to