IWithKeyDownAndUp.cs 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /**
  2. * Copyright (c) 2021 Vuplex Inc. All rights reserved.
  3. *
  4. * Licensed under the Vuplex Commercial Software Library License, you may
  5. * not use this file except in compliance with the License. You may obtain
  6. * a copy of the License at
  7. *
  8. * https://vuplex.com/commercial-library-license
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. using UnityEngine;
  17. namespace Vuplex.WebView {
  18. /// <summary>
  19. /// An interface implemented by a webview if it supports separate
  20. /// `KeyDown()` and `KeyUp()` methods.
  21. /// </summary>
  22. public interface IWithKeyDownAndUp {
  23. /// <summary>
  24. /// Dispatches a key down event to the webview.
  25. /// </summary>
  26. /// <param name="key">
  27. /// A key can either be a single character representing
  28. /// a unicode character (e.g. "A", "b", "?") or a [JavaScript Key value](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key/Key_Values)
  29. /// (e.g. "ArrowUp", "Enter").
  30. /// </param>
  31. /// <param name="modifiers">
  32. /// Modifier flags that can be used to trigger keyboard shortcuts.
  33. /// </param>
  34. void KeyDown(string key, KeyModifier modifiers);
  35. /// <summary>
  36. /// Dispatches a key up event to the webview.
  37. /// </summary>
  38. /// <param name="key">
  39. /// A key can either be a single character representing
  40. /// a unicode character (e.g. "A", "b", "?") or a [JavaScript Key value](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key/Key_Values)
  41. /// (e.g. "ArrowUp", "Enter").
  42. /// </param>
  43. /// <param name="modifiers">
  44. /// Modifier flags that can be used to trigger keyboard shortcuts.
  45. /// </param>
  46. void KeyUp(string key, KeyModifier modifiers);
  47. }
  48. }