1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-07-07 08:28:57 +00:00
CLK/OSBindings/Mac/Clock Signal/CSApplication.h
Thomas Harte f28c124039 Adds a route to divert key events before they reach Cocoa.
If you were to use this, it would have the effect of disabling in-app keyboard short-cuts in favour of routing keys to the emulated machine.
2019-09-22 13:15:01 -04:00

32 lines
896 B
Objective-C
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

//
// CSApplication.h
// Clock Signal
//
// Created by Thomas Harte on 22/09/2019.
// Copyright © 2019 Thomas Harte. All rights reserved.
//
#ifndef CSApplication_h
#define CSApplication_h
#import <Cocoa/Cocoa.h>
@protocol CSApplicationKeyboardEventDelegate
- (void)sendEvent:(nonnull NSEvent *)event;
@end
/*!
CSApplication differs from NSApplication in only one regard: it supports a keyboardEventDelegate.
If a keyboardEventDelegate is installed, all keyboard events — @c NSEventTypeKeyUp,
@c NSEventTypeKeyDown and @c NSEventTypeFlagsChanged — will be diverted to it
rather than passed through the usual processing. As a result keyboard shortcuts and assistive
dialogue navigations won't work.
*/
@interface CSApplication: NSApplication
@property(nonatomic, weak, nullable) id<CSApplicationKeyboardEventDelegate> keyboardEventDelegate;
@end
#endif /* CSApplication_h */