Flutter Engine
 
Loading...
Searching...
No Matches
FlutterKeyboardLayout.h
Go to the documentation of this file.
1// Copyright 2013 The Flutter 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
5#ifndef FLUTTER_SHELL_PLATFORM_DARWIN_MACOS_FRAMEWORK_SOURCE_FLUTTERKEYBOARDLAYOUT_H_
6#define FLUTTER_SHELL_PLATFORM_DARWIN_MACOS_FRAMEWORK_SOURCE_FLUTTERKEYBOARDLAYOUT_H_
7
8#import <AppKit/AppKit.h>
9
10namespace flutter {
11
12// The printable result of a key under certain modifiers, used to derive key
13// mapping.
14typedef struct {
15 // The printable character.
16 //
17 // If `isDeadKey` is true, then this is the character when pressing the same
18 // dead key twice.
19 uint32_t character;
20
21 // Whether this character is a dead key.
22 //
23 // A dead key is a key that is not counted as text per se, but holds a
24 // diacritics to be added to the next key.
27
28} // namespace flutter
29
30/**
31 * A delegate protocol for FlutterKeyboardLayout. Implemented by FlutterKeyboardManager.
32 */
33@protocol FlutterKeyboardLayoutDelegate
34
35/**
36 * Called when the active keyboard input source changes.
37 *
38 * Input sources may be simple keyboard layouts, or more complex input methods involving an IME,
39 * such as Chinese, Japanese, and Korean.
40 */
41- (void)keyboardLayoutDidChange;
42
43@end
44
45/**
46 * A class that allows querying the printable result of a key with a modifier state according to the
47 * current keyboard layout. It also provides a delegate protocol for clients interested in
48 * listening to keyboard layout changes.
49 */
50@interface FlutterKeyboardLayout : NSObject
51
52@property(readwrite, nonatomic, weak) id<FlutterKeyboardLayoutDelegate> delegate;
53
54/**
55 * Querying the printable result of a key under the given modifier state.
56 */
57- (flutter::LayoutClue)lookUpLayoutForKeyCode:(uint16_t)keyCode shift:(BOOL)shift;
58
59@end
60
61#endif // FLUTTER_SHELL_PLATFORM_DARWIN_MACOS_FRAMEWORK_SOURCE_FLUTTERKEYBOARDLAYOUT_H_
id< FlutterKeyboardLayoutDelegate > delegate
int BOOL