2019-09-19 09:27:56 +00:00
|
|
|
//
|
|
|
|
// View.swift
|
|
|
|
// A2Mac
|
|
|
|
//
|
|
|
|
// Created by Tamas Rudnai on 9/18/19.
|
|
|
|
// Copyright © 2019 GameAlloy. All rights reserved.
|
|
|
|
//
|
|
|
|
|
|
|
|
import Cocoa
|
|
|
|
|
2019-11-28 04:27:32 +00:00
|
|
|
class MonitorView: NSView {
|
2020-02-23 00:37:54 +00:00
|
|
|
// override func performKeyEquivalent(with event: NSEvent) -> Bool {
|
|
|
|
// return true
|
|
|
|
// }
|
|
|
|
|
|
|
|
// override func keyDown(with event: NSEvent) {
|
|
|
|
// print("MV KBD Event")
|
|
|
|
// // switch event.modifierFlags.intersection(.deviceIndependentFlagsMask) {
|
|
|
|
// // case [.command] where event.characters == "l",
|
|
|
|
// // [.command, .shift] where event.characters == "l":
|
|
|
|
// // print("command-l or command-shift-l")
|
|
|
|
// // default:
|
|
|
|
// // break
|
|
|
|
// // }
|
|
|
|
// // print( "key = " + (event.charactersIgnoringModifiers ?? ""))
|
|
|
|
// // print( "\ncharacter = " + (event.characters ?? ""))
|
|
|
|
//
|
|
|
|
// #if FUNCTIONTEST
|
|
|
|
// #else
|
|
|
|
// let keyCode = UInt32(event.keyCode)
|
|
|
|
// switch keyCode {
|
|
|
|
// case eLeftArrowKey:
|
|
|
|
// kbdInput(0x08)
|
|
|
|
// case eRightArrowKey:
|
|
|
|
// kbdInput(0x15)
|
|
|
|
// case eLeftArrowKey:
|
|
|
|
// kbdInput(0x0B)
|
|
|
|
// case eRightArrowKey:
|
|
|
|
// kbdInput(0x0A)
|
|
|
|
// default:
|
|
|
|
// // print("keycode: %d", keyCode)
|
|
|
|
// if let chars = event.characters {
|
|
|
|
// let char = chars.uppercased()[chars.startIndex]
|
|
|
|
// if let ascii = char.asciiValue {
|
|
|
|
// kbdInput(ascii)
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// #endif
|
|
|
|
//
|
|
|
|
// }
|
2019-09-19 09:27:56 +00:00
|
|
|
}
|
2020-02-23 00:37:54 +00:00
|
|
|
|
|
|
|
|