key_state.h 612 B

1234567891011121314151617181920212223242526
  1. // Copyright 2021 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #ifndef COMPONENTS_EXO_KEY_STATE_H_
  5. #define COMPONENTS_EXO_KEY_STATE_H_
  6. namespace ui {
  7. enum class DomCode;
  8. }
  9. namespace exo {
  10. // Represents the current pressed key state.
  11. struct KeyState {
  12. ui::DomCode code;
  13. bool consumed_by_ime;
  14. };
  15. inline bool operator==(const KeyState& lhs, const KeyState& rhs) {
  16. return lhs.code == rhs.code && lhs.consumed_by_ime == rhs.consumed_by_ime;
  17. }
  18. } // namespace exo
  19. #endif // COMPONENTS_EXO_KEY_STATE_H_