Search the Legacy Support Archive (up to v2020)
  1. Read-only archive (2005–2024). Posting is closed. Need help with MediaLab or DirectRT 2027? Email service@empirisoft.com.

    All words · “exact phrase” · -leave out

    Advanced search

Custom item: OnKeyPress allowed?

  1. #1

    Custom item: OnKeyPress allowed?

    Are OnKeyPress events allowed in a custom item in a MediaLab questionnaire or are they intercepted/not recognized by MediaLab? Thanks.

  2. #2
    jarvis24 Blair Jarvis, Administrator
    MediaLab uses Internet Explorer as its web engine so it should act exactly as it does in IE. It should accept onkeypress events in the same manner as any page in IE would. However, one difference is that the HTML window within MediaLab will need to have the "focus". Your javascript programmer will likely be able to cause this to happen automatically but you can also do it manually to test it. For the test, try clicking on the HTML page once before the onkeypress function is to be tested. Otherwise, the keypress may go to the MediaLab shell rather than to the contained HTML page.

  3. #3
    jarvis24 Blair Jarvis, Administrator
    [edited followup from support email]

    Thank you so much. My programmer here was able (after several attempts) to set the "focus" so that my custom item now works through MediaLab. I am much relieved!
    Have a great weekend

  4. #4
    jarvis24 Blair Jarvis, Administrator
    Any chance you might consider zipping and posting the item (including the focus setting code) for others who run into the same challenge? If it's top-secret, no worries--thanks for the update!

  5. #5
    Attached is the file with the html code that changes the focus of a custom item.