mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-04 17:10:47 +00:00
Reformatting *.mm files with clang-format
This commit is contained in:
committed by
Baldur Karlsson
parent
aca59e3f55
commit
e4cd163c5f
@@ -1,6 +1,6 @@
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
void getMetalLayerSize(void* layerHandle, int& width, int& height)
|
||||
void getMetalLayerSize(void *layerHandle, int &width, int &height)
|
||||
{
|
||||
CALayer *layer = (CALayer *)layerHandle;
|
||||
assert([layer isKindOfClass:[CALayer class]]);
|
||||
|
||||
@@ -30,28 +30,29 @@ static id s_eventMonitor;
|
||||
|
||||
void apple_InitKeyboard()
|
||||
{
|
||||
s_eventMonitor = [NSEvent addLocalMonitorForEventsMatchingMask:
|
||||
(NSEventMaskKeyDown|NSEventMaskKeyUp)
|
||||
handler:^(NSEvent *incomingEvent) {
|
||||
NSEvent *result = incomingEvent;
|
||||
//NSWindow *targetWindowForEvent = [incomingEvent window];
|
||||
//if (targetWindowForEvent == _window)
|
||||
{
|
||||
unsigned short keyCode = [incomingEvent keyCode];
|
||||
if ([incomingEvent type] == NSEventTypeKeyDown)
|
||||
{
|
||||
s_keysPressed[keyCode] = true;
|
||||
}
|
||||
if ([incomingEvent type] == NSEventTypeKeyUp)
|
||||
{
|
||||
s_keysPressed[keyCode] = false;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}];
|
||||
s_eventMonitor =
|
||||
[NSEvent addLocalMonitorForEventsMatchingMask:(NSEventMaskKeyDown | NSEventMaskKeyUp)
|
||||
handler:^(NSEvent *incomingEvent) {
|
||||
NSEvent *result = incomingEvent;
|
||||
// NSWindow *targetWindowForEvent = [incomingEvent
|
||||
// window];
|
||||
// if (targetWindowForEvent == _window)
|
||||
{
|
||||
unsigned short keyCode = [incomingEvent keyCode];
|
||||
if([incomingEvent type] == NSEventTypeKeyDown)
|
||||
{
|
||||
s_keysPressed[keyCode] = true;
|
||||
}
|
||||
if([incomingEvent type] == NSEventTypeKeyUp)
|
||||
{
|
||||
s_keysPressed[keyCode] = false;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}];
|
||||
}
|
||||
|
||||
bool apple_IsKeyPressed(int appleKeyCode)
|
||||
{
|
||||
return s_keysPressed[appleKeyCode];
|
||||
return s_keysPressed[appleKeyCode];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user