ModifierKey.h 642 B

12345678910111213141516171819202122232425
  1. // Copyright 2019 Google LLC.
  2. // Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
  3. #ifndef ModifierKey_DEFINED
  4. #define ModifierKey_DEFINED
  5. #include "include/private/SkBitmaskEnum.h"
  6. enum class ModifierKey {
  7. kNone = 0,
  8. kShift = 1 << 0,
  9. kControl = 1 << 1,
  10. kOption = 1 << 2, // same as ALT
  11. kCommand = 1 << 3,
  12. kFirstPress = 1 << 4,
  13. };
  14. namespace skstd {
  15. template <> struct is_bitmask_enum<ModifierKey> : std::true_type {};
  16. }
  17. static inline bool ModifierKeyIsSet(ModifierKey m) {
  18. return m != ModifierKey::kNone;
  19. }
  20. #endif // ModifierKey_DEFINED