Skip to Content
author's profile photo
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 comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

2 Answers

  • author's profile photo
    Former Member
    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 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
    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 comment
    10|10000 characters needed characters exceeded