FreeRDP
Loading...
Searching...
No Matches
RDPKeyboard.h
1/*
2 RDP Keyboard helper
3
4 Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz
5
6 This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
7 If a copy of the MPL was not distributed with this file, You can obtain one at
8 http://mozilla.org/MPL/2.0/.
9 */
10
11#import <Foundation/Foundation.h>
12#import "RDPSession.h"
13
14@class RDPKeyboard;
15
16@protocol RDPKeyboardDelegate <NSObject>
17@optional
18- (void)modifiersChangedForKeyboard:(RDPKeyboard *)keyboard;
19@end
20
21@interface RDPKeyboard : NSObject
22{
23
24 RDPSession *_session;
25
26 int _virtual_key_map[256];
27 BOOL _virtual_key_shift_map[256];
28
29 NSObject<RDPKeyboardDelegate> *_delegate;
30
31 BOOL _ctrl_pressed;
32 BOOL _alt_pressed;
33 BOOL _shift_pressed;
34 BOOL _win_pressed;
35}
36
37@property(assign) id<RDPKeyboardDelegate> delegate;
38@property(readonly) BOOL ctrlPressed;
39@property(readonly) BOOL altPressed;
40@property(readonly) BOOL shiftPressed;
41@property(readonly) BOOL winPressed;
42
43// returns a keyboard instance
44+ (RDPKeyboard *)getSharedRDPKeyboard;
45
46// init the keyboard and assign the given rdp session and delegate
47- (void)initWithSession:(RDPSession *)session delegate:(NSObject<RDPKeyboardDelegate> *)delegate;
48
49// called to reset any pending key states (i.e. pressed modifier keys)
50- (void)reset;
51
52// sends the given unicode character to the server
53- (void)sendUnicode:(int)character;
54
55// send a key stroke event using the given virtual key code
56- (void)sendVirtualKeyCode:(int)keyCode;
57
58// send a single key down or up event for the given virtual key code
59- (void)sendVirtualKey:(int)vKey up:(BOOL)up;
60
61// toggle ctrl key, returns true if pressed, otherwise false
62- (void)toggleCtrlKey;
63
64// toggle alt key, returns true if pressed, otherwise false
65- (void)toggleAltKey;
66
67// toggle shift key, returns true if pressed, otherwise false
68- (void)toggleShiftKey;
69
70// toggle windows key, returns true if pressed, otherwise false
71- (void)toggleWinKey;
72
73// send key strokes
74- (void)sendEnterKeyStroke;
75- (void)sendEscapeKeyStroke;
76- (void)sendBackspaceKeyStroke;
77
78@end