Getting Keydown(key) for PageDown & Up

  1. last week

    Arthur G

    Dec 3 Pre-Release Testers

    I would like to capture the keydown key for pagedown and pageup.
    I have tried to use Keyboard.AsyncKeyDown(74) and (79) followed by Return False with a breakpoint there.
    I'm not getting results.

    If Keyboard.AsyncKeyDown(74) Then//PageUp
      Return False//breakpoint here
    ElseIf Keyboard.AsyncKeyDown(79) Then//PageDown
      Return False//breakpoint here
    End If

    Suggestions?

    Here's a demo project that shows how to do this with both the Event and the Async functionality.
    Working fine with 2018r3, Mac 10.14, En-US keyboard.

    pagedown.xojo_binary_project

  2. Jean-Yves P

    Dec 3 Pre-Release Testers, Xojo Pro Europe (France, Besançon)

    where did you put this code into ? which event ?
    it should be in a keydown event
    put a breakpoint there and see what is inside the parameter Key to get the good code.

  3. Tim H

    Dec 3 Pre-Release Testers Portland, OR USA

    Your values are the hex values, not decimal. Use 116/121, or use the &h notation to pass the hex values (&h74/&h79).

  4. Arthur G

    Dec 3 Pre-Release Testers

    My problem is I am using a Mac Laptop which doesn't have a pagedown. You use Fn+ArrowKey which is what I get.

  5. Dave S

    Dec 3 San Diego, California USA

    the ASCB values are 28 thru 31 if I recall for use in KEYDOWN

  6. Tim P

    Dec 3 Pre-Release Testers feedback://46303

    Note the difference between AsyncKeyDown and KeyDown, you likely don't want the Async one.

  7. Arthur G

    Dec 3 Pre-Release Testers

    I just tested Keyboard.AsyncKeyDown(&h79) on my PC which has a normal keyboard. and it works.

    Just for clarification, I am also asking because one isn't supposed to use async in the Keydown event.

    It could be I haven't rebooted my laptop in a while but not likely.

  8. Tim P

    Dec 3 Pre-Release Testers Answer feedback://46303

    Here's a demo project that shows how to do this with both the Event and the Async functionality.
    Working fine with 2018r3, Mac 10.14, En-US keyboard.

    pagedown.xojo_binary_project

  9. Arthur G

    Dec 3 Pre-Release Testers

    Thanks. It works and I can capture it in KeyDown.

    I wonder what is going on.

  10. Arthur G

    Dec 3 Pre-Release Testers

    Thanks Tim. In your example you used

    select case asc(Key)
    case 11
      

    I was missing the ascii 11.

or Sign Up to reply!