1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

ui is in a separate repo for now, rename it to avoid conflicts

This commit is contained in:
Alexander Medvednikov
2020-01-01 13:14:01 +01:00
parent e53bb6a9d4
commit e8bbb00bde
8 changed files with 0 additions and 0 deletions

32
vlib/uiold/ui_darwin.v Normal file
View File

@ -0,0 +1,32 @@
module ui
#flag -framework Carbon
#flag -framework Cocoa
#include <Cocoa/Cocoa.h>
#include <Carbon/Carbon.h>
__global default_font *C.NSFont
fn focus_app(next, event, data voidptr) {
#NSLog(@"2The hot key was pressed.");
#NSApplication *myApp = [NSApplication sharedApplication];
#[myApp activateIgnoringOtherApps:YES];
//return noErr;
}
pub fn reg_key_vid() {
println('REGISTERING VID KEY')
#EventHotKeyRef gMyHotKeyRef;
#EventHotKeyID gMyHotKeyID;
#EventTypeSpec eventType;
#eventType.eventClass = kEventClassKeyboard;
#eventType.eventKind = kEventHotKeyPressed;
#InstallApplicationEventHandler(&ui__focus_app, 1, &eventType, NULL, NULL);
#gMyHotKeyID.signature = 'rml1';
#gMyHotKeyID.id = 1;
#RegisterEventHotKey(kVK_ANSI_1, cmdKey, gMyHotKeyID,
#GetApplicationEventTarget(), 0, &gMyHotKeyRef);
}