Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(970)

Unified Diff: remoting/ios/key_input.h

Issue 186733007: iOS Chromoting Client (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: remoting/ios/key_input.h
diff --git a/remoting/ios/key_input.h b/remoting/ios/key_input.h
new file mode 100644
index 0000000000000000000000000000000000000000..ec1d7cc4b916f1f82fdb7aa43ae898b13119f742
--- /dev/null
+++ b/remoting/ios/key_input.h
@@ -0,0 +1,31 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef REMOTING_IOS_KEY_INPUT_H_
+#define REMOTING_IOS_KEY_INPUT_H_
+
+#import <Foundation/Foundation.h>
+#import <UIKit/UIKit.h>
+
+// Key codes are translated from the on screen keyboard to the scan codes
+// needed for Chromoting input. We don't have a good automated approach to do
+// this. Instead we have created a mapping manually via trial and error. To
+// support other keyboards in this context we would have to test and create a
+// mapping for each keyboard manually.
+
+// Contract to handle translated key presses from the on-screen keyboard to
+// the format requried for Chromoting keyboard input
+@protocol KeyInputDelegate <NSObject>
+
+- (void)keyboardActionKeyCode:(uint32_t)keyPressed isKeyDown:(BOOL)keyDown;
+
+@end
+
+@interface KeyInput : UIView<UIKeyInput>
+
+@property(weak, nonatomic) id<KeyInputDelegate> delegate;
+
+@end
+
+#endif // REMOTING_IOS_KEY_INPUT_H_

Powered by Google App Engine
This is Rietveld 408576698