Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: Capturing key press in VFP custom section

  1. #1
    Senior Member
    Join Date
    Feb 2012
    Posts
    1,214

    Capturing key press in VFP custom section

    Hi,

    I have several items that I need to have the user move around on the screen.
    To make this quick, I allow different keystrokes for the different items.

    Is it possible to use something like "on key label ctrl+leftArrow mytext.left = mytext.left -2"

    Thanks.

    Herb

  2. #2
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    5,771
    Hi Herb,

    Thats an old foxpro command. Not supported.

    What sort of UI controls is it that you want to move about the screen? What type of section are these in?
    Principal developer of Lianja, Recital and other products

    Follow me on:

    Twitter: http://twitter.com/lianjaInc
    Facebook: http://www.facebook.com/LianjaInc
    LinkedIn: http://www.linkedin.com/in/barrymavin

  3. #3
    Senior Member
    Join Date
    Feb 2012
    Posts
    1,214
    Hi Barry,

    These are images that I need to move side-by-side (and sometimes overlay).

    In the application that I am replacing, I use different keystrokes to change the focus between images and then the arrow keys to move them.

    This would be in either a custom VFP section or a Canvas VFP section.

    Thanks.

    Herb

  4. #4
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    5,771
    Hi Herb,

    An image In a custom section the KEYPRESS event handler is called with 2 args:

    proc mykeypress(keycode as numeric, keymodifiers as numeric)
    // your code here
    endproc
    Principal developer of Lianja, Recital and other products

    Follow me on:

    Twitter: http://twitter.com/lianjaInc
    Facebook: http://www.facebook.com/LianjaInc
    LinkedIn: http://www.linkedin.com/in/barrymavin

  5. #5
    Senior Member
    Join Date
    Feb 2012
    Posts
    1,214
    Hi Barry,

    I am not seeing a keypress delegate in the custom section.
    But perhaps I am not understanding exactly how to do this.

    Thanks

    Herb

  6. #6
    Lianja MVP
    Join Date
    Feb 2012
    Location
    Berea, KY, USA
    Posts
    1,948
    Hi Herb,

    So you're looking for something ike ON KEY LABEL etc. from VFP?

  7. #7
    Senior Member
    Join Date
    Feb 2012
    Posts
    1,214
    Yes - and I think it had it working a while back, but I am not as young as I used to be....

  8. #8
    Lianja Team yvonne.milne's Avatar
    Join Date
    Feb 2012
    Location
    Berkshire, UK
    Posts
    1,379
    Hi Herb,

    Use the Section Hotkey event delegate.

    v3.2: Added a new "Hotkey" delegate to "App", "Page" and "Section". This is only called in runtime mode so you need to switch into that mode to test your delegates. The delegate is called with one argument which is the keycode string e.g. "F5", "Ctrl+F5", "Ctrl+Shift+F5". If the current section has a hotkey delegate that is called otherwise if the page has a hotkey delegate that is called otherwise if the app has a hotkey delegate that is called.

    Regards,

    Yvonne

  9. #9
    Senior Member
    Join Date
    Feb 2012
    Posts
    1,214
    Thanks Yvonne- this is perfect!

  10. #10
    Senior Member
    Join Date
    Feb 2012
    Posts
    1,214
    Hi Yvonne,

    What are the rules around hotkeys?
    ctrl+right works, so does left, up and down.

    what about ctrl+z or ctrl+shift? those don't seem to work.

    Thanks


    Herb

Page 1 of 2 12 LastLast

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Journey into the Cloud
Join us