Alpha Video Training
Results 1 to 9 of 9

Thread: F keys

  1. #1
    Chuck Mitchell
    Guest

    Default F keys

    Is there a way to program the F keys to do certain things?? Such as F5 would enter a new client, F6 would go to a new invoice....etc....?????

  2. #2
    "Certified" Alphaholic Scott Emerick's Avatar
    Real Name
    Scott Emerick
    Join Date
    Dec 2000
    Location
    Central Virginia/ North Carolina Border
    Posts
    2,154

    Default RE: F keys

    Chuck,

    The answer to your question is yes.

    Use the "ONKEY" function.

    Here is an example:

    If a_user.key.value = "{F5}"
    a_user.key.handled = .T.
    'YOUR ACTION HERE
    End If

    Hope this helps,

    Scott

  3. #3
    "Certified" Alphaholic
    Real Name
    Richard Coleman
    Join Date
    Oct 2000
    Location
    Franklin, TN
    Posts
    1,206

    Default RE: F keys

    Would this also work for ALT+some key, CTL+some key or ALT+CTL+some key???????

    Dick Coleman

  4. #4
    "Certified" Alphaholic Scott Emerick's Avatar
    Real Name
    Scott Emerick
    Join Date
    Dec 2000
    Location
    Central Virginia/ North Carolina Border
    Posts
    2,154

    Default RE: F keys

    Dick,

    Yes! the % is for ALT and the ^ is for CTL

    {%f} = ALT+f
    {^f} = CTL+f
    {%^f} = ALT+CTL+f

    Scott

  5. #5
    "Certified" Alphaholic
    Real Name
    Tom Cone Jr
    Join Date
    Apr 2000
    Location
    Florida
    Posts
    23,300

    Default RE: F keys

    Dick,

    the OnKey events available for forms are discussed in the Events section of the Programming with Xbasic chapter in the Xbasic Reference.

    See also, the discussion of the function

    sys_send_keys()

    for a table listing the identifiers used by Alpha Five for different keystroke combinations.

    -- tom

  6. #6
    "Certified" Alphaholic
    Real Name
    Richard Coleman
    Join Date
    Oct 2000
    Location
    Franklin, TN
    Posts
    1,206

    Default RE: F keys

    this might be moot or even dumb???

    Is A5 quick enuff to differentiate between:
    CTL+ALT+f and ALT+CTL+f ???????

    Or does it matter in which sequence the ALT and the CTL are pressed....????

    I've never known it to matter in DOS or Windows, but one can never tell...

    D

  7. #7
    "Certified" Alphaholic Scott Emerick's Avatar
    Real Name
    Scott Emerick
    Join Date
    Dec 2000
    Location
    Central Virginia/ North Carolina Border
    Posts
    2,154

    Default RE: F keys

    Dick,

    I could be wrong, but I don't think there is a key sequence issue. Its either they are both held down or not. I would stick with {%^F} sysntax since this is how the key recorder shows it.

    Scott

  8. #8
    "Certified" Alphaholic
    Real Name
    Cal Locklin
    Join Date
    Mar 2000
    Location
    S.E. Michigan
    Posts
    5,763

    Default RE: F keys

    You already have the answer - use the OnKey function - but here is some other food for thought....

    After much trial an error, I've settled on the following:
    F8 = Alt-DownArrow (to open drop-downs without the mouse)
    F9 remains the Save key.
    F10 = Push the "Enter_btn" button.
    F11 = Push the "Find_btn" button.
    F12 = Push the "Done_btn" button.

    F8 normally switches to the browse view but I have never had a situation where I want my users to arbitrarily switch to the browse where they have full access to the system menu and toolbar. So, if I want them to be able to access a browse, it's usually an embedded browse on a form. At any rate, I want the normal F8-to-browse function disabled so using it to open drop-downs works great for me.

    The F10-12 keys push a button so that the OnKey code can remain standard anywhere in my app(s) and specific code can be put in the button itself. The only "trick" here then is to make sure the button gets named as above even if, for example, the text in the Done_btn is Close, Exit, Return, etc.

    Here's the exact code I use for the F12 action:

    IF a_user.key.value = "{F12}"
    a_user.key.handled = .T.
    IF a_user.key.event = "down"
    parentform:Done_btn.push()
    END IF
    END IF

  9. #9
    "Certified" Alphaholic
    Real Name
    Richard Coleman
    Join Date
    Oct 2000
    Location
    Franklin, TN
    Posts
    1,206

    Default RE: F keys

    Understand about the 'done_btn' but not the other two..

    enter_btn and find_btn.....

    could you give me a brief idea of what they are doing when pressed???

    thanx in advance
    D

Similar Threads

  1. Hot Keys
    By davej in forum Alpha Five Version 5
    Replies: 2
    Last Post: 05-01-2005, 08:45 AM
  2. Shortcut keys
    By David Priest in forum Alpha Five Version 5
    Replies: 1
    Last Post: 03-17-2004, 05:32 AM
  3. Hot keys
    By dik_coleman in forum Alpha Five Version 5
    Replies: 4
    Last Post: 12-29-2003, 04:27 AM
  4. Unique keys
    By George Schaefer in forum Announcements
    Replies: 1
    Last Post: 11-20-2001, 05:00 AM
  5. Control keys (hot keys)
    By Lowell Wardlow in forum Alpha Five Version 4
    Replies: 0
    Last Post: 09-25-2000, 08:42 AM

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
  •