Skip to Content
author's profile photo Former Member
Former Member

UI: Catch key pressed when in EditField

Hi all

I would like to implement an alternative way of selecting items when in an order or invoice.

Normally when in an order you would press <TAB> to select items; I would like to catch the event that some other key has been pressed eg. PgDn or any other key to activate my alternative Item selection. The problem is that I don't seem to get an event that a key is presed when the cursor is in an EditField.

I can create a button, but I would like to activate it through a keystroke.

Any good ideas?

Best regards

Jesper Carstensen

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Jun 02, 2004 at 10:06 AM

    The et_KEY_DOWN event fires when you press keys in an edit box, you can use this to provide shortcut keys to alternate selection screens. I have several addons that use this technique. I normally use CTRL TAB or just TAB as the shortcut keys.

    Below is an example from a custom form.

    If pVal.EventType = et_KEY_DOWN And _

    pVal.ItemUID = "edtCard" And _

    pVal.Before_Action = True And _

    pVal.CharPressed = 9 Then

    If sboForm.Items("edtCard").Specific.String = ""

    Call LookupCustomer(sboApp)

    End If

    End If

    Regards,

    John.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      My understanding is that et_KEY_DOWN fires when a key is pressed and the focus is currently on an editable form item such as an edit box.

      I have not had any use for the et_FORM_KEY_DOWN event yet, but I believe it fires when a key is pressed and the focus is not on a form item. eg. If you press a key in a form where all items are inactive.

      John.

  • author's profile photo Former Member
    Former Member
    Posted on Jun 03, 2004 at 06:07 AM

    Hi,

    <u>Just a short FYI:</u>

    et_KEY_DOWN will not catch mode changes (like Caps Lock, Insert Mode, shift etc) or any other external keys (like "Windows" key, right click key etc).

    et_KEY_DOWN will also not catch all "F" keys (e.g. F1 - F12)

    Best regards,

    Yaniv Gamliel

    SDK Consultant

    SAP Manage Israel

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.