I put them in a folder called "Input".
- Keyboard.swift
- Mouse.swift
- Keycodes.swift
- ViewInputExtension.swift
- Common keycodes based on ascii characters. Primarily used with keyboard.swift
- This file is used to keep track of current keys that are pressed
- This file is used to track mouse movement and mouse clicks
- This file is used to extend your NSView with mouse/keyboard input reading.
-
Each extension is based of of the NSView / MTKView that you are extending so all you need to do is replace GameView with your views name.
-
Example:
class MyViewName: NSView {}
extension MyViewName { ... }