physical_keyboard_detector.h 726 B

1234567891011121314151617181920
  1. // Copyright 2017 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 REMOTING_IOS_APP_PHYSICAL_KEYBOARD_DETECTOR_H_
  5. #define REMOTING_IOS_APP_PHYSICAL_KEYBOARD_DETECTOR_H_
  6. #import <UIKit/UIKit.h>
  7. // A class for detecting whether an physical keyboard is presented.
  8. @interface PhysicalKeyboardDetector : NSObject
  9. // |callback| will be called with YES if an physical keyboard is presented.
  10. // Note that you'll need to manually restore the first responder after the
  11. // detection is done.
  12. + (void)detectOnView:(UIView*)view callback:(void (^)(BOOL))callback;
  13. @end
  14. #endif // REMOTING_IOS_APP_PHYSICAL_KEYBOARD_DETECTOR_H_