Alpha Video Training
Results 1 to 4 of 4

Thread: Keycodes??

  1. #1
    Member
    Real Name
    Chet Sapino
    Join Date
    Jun 2002
    Location
    East Syracuse, NY
    Posts
    355

    Default Keycodes??

    I would like to intercept some function key presses on a form, and execute a script.

    e.g, F2, F4, etc. I would specifically like to press F4 and go into data entry mode in a browse. IMO Ctrl-E is antiquated and cumbersome especially when clients want to do fast data entry. I want to avoid the use of the mouse for a customer.

    Does anyone have code for this going into the OnKey event?

    TIA,
    Regards,
    Chet Sapino
    President,
    SAPINO Enterprises
    6451 Pheasant Rd
    East Syracuse, NY 13057

  2. #2
    VAR davej's Avatar
    Real Name
    Dave Jampole
    Join Date
    Apr 2000
    Location
    Haughton, LA ( just east of Shreveport, Louisiana)
    Posts
    2,524

    Default Re: Keycodes??

    Chet,

    Take a look at AutoHotKey <http://www.autohotkey.com/>. It is a free program and with it you can:

    Automate almost anything by sending keystrokes and mouse clicks. You can write a mouse or keyboard macro by hand or use the macro recorder.
    • Create hotkeys for keyboard, joystick, and mouse. Virtually any key, button, or combination can become a hotkey.
    • Expand abbreviations as you type them. For example, typing "btw" can automatically produce "by the way".
    • Create custom data-entry forms, user interfaces, and menu bars. See GUI for details.
    • Remap keys and buttons on your keyboard, joystick, and mouse.
    • Respond to signals from hand-held remote controls via the WinLIRC client script.
    • Run existing AutoIt v2 scripts and enhance them with new capabilities.
    • Convert any script into an EXE file that can be run on computers that don't have AutoHotkey installed.
    Dave
    Dave Jampole
    www.customalpha.com

    Women and cats will do whatever they want. The sooner men and dogs realize that, the happier they will be.


  3. #3
    "Certified" Alphaholic
    Real Name
    Jeff Kletrovets
    Join Date
    Oct 2005
    Location
    Columbus, OH
    Posts
    1,135

    Default Re: Keycodes??

    Chet,

    Not exactly sure what you are looking for since you had the OnKey function listed in your original post and there is a pretty good example in the help file. In case you missed this though...

    Code:
    IF a_user.key.value = "{<Key_to_be_trapped>}" THEN
        a_user.key.handled = .T.
        IF a_user.key.event = "down" THEN
             <Action_to_be_taken>
        END IF
    END IF

    Regards,

    Jeff

  4. #4
    Member
    Real Name
    Chet Sapino
    Join Date
    Jun 2002
    Location
    East Syracuse, NY
    Posts
    355

    Default Re: Keycodes??

    Thanks for the information! I appreciate it.

    The code is what I'm looking for. I knew that code was somewhere in the help. I saw it before but I couldn't seem to find it.

    I'll also look into the hotkey stuff. Looks interesting.
    Regards,
    Chet Sapino
    President,
    SAPINO Enterprises
    6451 Pheasant Rd
    East Syracuse, NY 13057

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
  •