|
Packit |
1fb8d4 |
/*
|
|
Packit Service |
5a9772 |
RDP Keyboard helper
|
|
Packit Service |
5a9772 |
|
|
Packit |
1fb8d4 |
Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz
|
|
Packit Service |
5a9772 |
|
|
Packit Service |
5a9772 |
This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
|
|
Packit Service |
5a9772 |
If a copy of the MPL was not distributed with this file, You can obtain one at
|
|
Packit Service |
5a9772 |
http://mozilla.org/MPL/2.0/.
|
|
Packit |
1fb8d4 |
*/
|
|
Packit |
1fb8d4 |
|
|
Packit |
1fb8d4 |
#import <Foundation/Foundation.h>
|
|
Packit |
1fb8d4 |
#import "RDPSession.h"
|
|
Packit |
1fb8d4 |
|
|
Packit |
1fb8d4 |
@class RDPKeyboard;
|
|
Packit |
1fb8d4 |
|
|
Packit |
1fb8d4 |
@protocol RDPKeyboardDelegate <NSObject>
|
|
Packit |
1fb8d4 |
@optional
|
|
Packit Service |
5a9772 |
- (void)modifiersChangedForKeyboard:(RDPKeyboard *)keyboard;
|
|
Packit |
1fb8d4 |
@end
|
|
Packit |
1fb8d4 |
|
|
Packit Service |
5a9772 |
@interface RDPKeyboard : NSObject
|
|
Packit Service |
5a9772 |
{
|
|
Packit |
1fb8d4 |
|
|
Packit Service |
5a9772 |
RDPSession *_session;
|
|
Packit |
1fb8d4 |
|
|
Packit |
1fb8d4 |
int _virtual_key_map[256];
|
|
Packit Service |
5a9772 |
int _unicode_map[256];
|
|
Packit Service |
5a9772 |
NSDictionary *_special_keys;
|
|
Packit Service |
5a9772 |
|
|
Packit Service |
5a9772 |
NSObject<RDPKeyboardDelegate> *_delegate;
|
|
Packit |
1fb8d4 |
|
|
Packit |
1fb8d4 |
BOOL _ctrl_pressed;
|
|
Packit Service |
5a9772 |
BOOL _alt_pressed;
|
|
Packit Service |
5a9772 |
BOOL _shift_pressed;
|
|
Packit Service |
5a9772 |
BOOL _win_pressed;
|
|
Packit |
1fb8d4 |
}
|
|
Packit |
1fb8d4 |
|
|
Packit Service |
5a9772 |
@property(assign) id<RDPKeyboardDelegate> delegate;
|
|
Packit Service |
5a9772 |
@property(readonly) BOOL ctrlPressed;
|
|
Packit Service |
5a9772 |
@property(readonly) BOOL altPressed;
|
|
Packit Service |
5a9772 |
@property(readonly) BOOL shiftPressed;
|
|
Packit Service |
5a9772 |
@property(readonly) BOOL winPressed;
|
|
Packit |
1fb8d4 |
|
|
Packit |
1fb8d4 |
// returns a keyboard instance
|
|
Packit Service |
5a9772 |
+ (RDPKeyboard *)getSharedRDPKeyboard;
|
|
Packit |
1fb8d4 |
|
|
Packit |
1fb8d4 |
// init the keyboard and assign the given rdp session and delegate
|
|
Packit Service |
5a9772 |
- (void)initWithSession:(RDPSession *)session delegate:(NSObject<RDPKeyboardDelegate> *)delegate;
|
|
Packit |
1fb8d4 |
|
|
Packit |
1fb8d4 |
// called to reset any pending key states (i.e. pressed modifier keys)
|
|
Packit |
1fb8d4 |
- (void)reset;
|
|
Packit |
1fb8d4 |
|
|
Packit |
1fb8d4 |
// sends the given unicode character to the server
|
|
Packit |
1fb8d4 |
- (void)sendUnicode:(int)character;
|
|
Packit |
1fb8d4 |
|
|
Packit |
1fb8d4 |
// send a key stroke event using the given virtual key code
|
|
Packit |
1fb8d4 |
- (void)sendVirtualKeyCode:(int)keyCode;
|
|
Packit |
1fb8d4 |
|
|
Packit |
1fb8d4 |
// toggle ctrl key, returns true if pressed, otherwise false
|
|
Packit |
1fb8d4 |
- (void)toggleCtrlKey;
|
|
Packit |
1fb8d4 |
|
|
Packit |
1fb8d4 |
// toggle alt key, returns true if pressed, otherwise false
|
|
Packit |
1fb8d4 |
- (void)toggleAltKey;
|
|
Packit |
1fb8d4 |
|
|
Packit |
1fb8d4 |
// toggle shift key, returns true if pressed, otherwise false
|
|
Packit |
1fb8d4 |
- (void)toggleShiftKey;
|
|
Packit |
1fb8d4 |
|
|
Packit |
1fb8d4 |
// toggle windows key, returns true if pressed, otherwise false
|
|
Packit |
1fb8d4 |
- (void)toggleWinKey;
|
|
Packit |
1fb8d4 |
|
|
Packit |
1fb8d4 |
// send key strokes
|
|
Packit |
1fb8d4 |
- (void)sendEnterKeyStroke;
|
|
Packit |
1fb8d4 |
- (void)sendEscapeKeyStroke;
|
|
Packit |
1fb8d4 |
- (void)sendBackspaceKeyStroke;
|
|
Packit |
1fb8d4 |
|
|
Packit |
1fb8d4 |
@end
|