No announcement yet.

On Key when Grid is selected

  • Filter
  • Time
  • Show
Clear All
new posts

  • On Key when Grid is selected

    Hi, hope you can help me with this one
    When a key is pressed it is easy to trigger an action...unless Grid object (or any other) is selected.
    Is there a way to still retrieve key pressed when Grid object is currently selected, more specifically a cell is selected by user?

    Thanks in advance.

    David Ramirez

  • #2
    Not sure What you are talking about -
    but is this what U R after


    • #3
      charliechaps, even though I didn´t explain myself very understood! Thanks I will implement that logic to my project. What I was trying to say is this: Let´s say I want to show an input message whenever the user presses key F8. That is simple, works with the following code:

      if e_Key==119 then[INDENT]local real_password = "abc";
      local user_password = Dialog.PasswordInput("Password", "Type password: ", MB_ICONQUESTION);[/INDENT][INDENT]if real_password == user_password then[/INDENT][INDENT]Access = true[/INDENT][INDENT]end[/INDENT]
      That works every time the users presses F8...except when user selects an object, for example selects an item in a combobox or selects a cell in a grid, then while that selection is active pressing F8 won´t show any message. The code above is ignored. It is a scenario that has happened many times.

      David Ramirez


      • #4
        I'm sorry David but you have to tell AMS that if an object is selected it can run your e_Key press.
        Put your F8 code in Globals then call from the objects "On Key" event.
        If it does not have one like an image or input box etc then either use code or you can use a "Keystroke.dll" by Worm to mimic a key press F8.

        This code is not ignored it is just not fired correctly.
        In attached example have included Keystroke and SendKey.Check and see if it's doing what you want
        F8 Example.apz


        • #5
          I attach my (failed) attempt with Grid. Actually I am using Grids to display data and interact with user.
          For what I understand, Keystroke.DLL is used to "force" or simulate keypress. More than forcing I need to capture whenever user press F8.

          I also checked this thread and that is why I mention the word "force" keypress rather than actually retrieve.

          David Ramirez
          Attached Files