Uploaded image for project: 'ZK'
  1. ZK
  2. ZK-4653

Provide a collection of constants for Keys and provide isPressed API

XMLWordPrintable

    • Icon: New Feature New Feature
    • Resolution: Done
    • Icon: Normal Normal
    • 9.5.0
    • None
    • None
    • None

      Current

      doKeyDown_: function (evt) {
          switch (evt.key) {
              case 'Escape':
                  // blah
                  break;
              case 'Space':
                  // blah
                  break;
          }
      }
      

      Proposed new API

      doKeyDown_: function (evt) {
          if (evt.isPressed(Keys.ESCAPE)) {
              // blah
          } else if (evt.isPressed(Keys.SPACE)) {
              // blah
          }
      }
      

      isPressed(...keys: string[]): boolean

      Parameters:
      1. keys: which key including modifiers if any

      Returns:
      Is the key pressed?

      Keys

      A collection of constants. Users don't have to remember how to spell the correct keyword.
      Please refer to Selenium [Keys](https://www.selenium.dev/selenium/docs/api/py/_modules/selenium/webdriver/common/keys.html#Keys)

            Leon03 Leon03
            Leon03 Leon03
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 1 day, 4 hours
                1d 4h
                Remaining:
                Remaining Estimate - 1 day, 4 hours
                1d 4h
                Logged:
                Time Spent - Not Specified
                Not Specified