AppKit Carbon key codes to UIKey-compatible enums

Overview

Github CI

KeyCodes

Versions of UIKey, UIKeyboardHIDUsage, and UIKeyModifierFlags that work with AppKit's NSEvent. No need for Carbon.HIToolbox. Aside from being a nicer API to work with, these versions should make it possible to more easily write source-compatible AppKit/UIKit keyboard handling code. Yes, this is basically a gigantic switch statement.

These structures are particularly helpful for writing tests. Constructing NSEvent instances by hand is a pain.

⚠️ Not all keycodes are mapped yet. There are a lot.

Integration

Swift Package Manager

dependencies: [
    .package(url: "https://github.com/ChimeHQ/KeyCodes")
]

Suggestions or Feedback

We'd love to hear from you! Get in touch via twitter, an issue, or a pull request.

Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.

You might also like...
Match animations in SwiftUI and UIKit/AppKit
Match animations in SwiftUI and UIKit/AppKit

MatchedAnimation Match animations in SwiftUI and UIKit/AppKit. /// Draw a box in

Catalyst example using an AppKit-provided NSVisualEffectView to provide a translucent blurred window
Catalyst example using an AppKit-provided NSVisualEffectView to provide a translucent blurred window

CatalystEffectViewChrome This project demonstrates how to insert an NSVisualEffe

A Swift library for documenting, isolating, and testing SwiftUI, UIKIt & AppKit components.
A Swift library for documenting, isolating, and testing SwiftUI, UIKIt & AppKit components.

A Swift library for documenting, isolating, and testing SwiftUI, UIKit & AppKit components. Minimal Example An example demonstrated with the Slider ui

FastLayout - A UIKit or AppKit package for fast UI design

FastLayout FastLayout is a UIKit or AppKit package for fast UI design. Layout Ex

The sample implementation of zip-archived document for a macOS AppKit platform.
The sample implementation of zip-archived document for a macOS AppKit platform.

The sample implementation of zip-archived document for a macOS AppKit platform. You can implement NSDocument-based I/O of archived document in your application like .sketch or .key.

This is a simple Mac Catalyst example showcasing how to build a dropdown menu toolbar button using AppKit.
This is a simple Mac Catalyst example showcasing how to build a dropdown menu toolbar button using AppKit.

CatalystToolbarMenuButton This is a simple Mac Catalyst example showcasing how to build a dropdown menu toolbar button using AppKit. There are ways to

Theme handling macOS Appkit (Swift/Objective-C)

DSFAppearanceManager A class for simplifying macOS appearance values and detecting setting changes (Swift/Objective-C). Why? If you're performing cust

RichTextKit is a Swift-based library for working with rich text in UIKit, AppKit and SwiftUI.
RichTextKit is a Swift-based library for working with rich text in UIKit, AppKit and SwiftUI.

About RichTextKit RichTextKit is a Swift-based library that lets you work with rich text in UIKit, AppKit and SwiftUI. RichTextKit is under developmen

RavynOS File manager built in Cocoa/Appkit and ObjC

Filer A file manager and re-implementation of macOS's Finder. A key component of ravynOS, Filer is the first application you see after you start ravyn

Swiftly convert country codes and cultural terms to all 269 emoji flags without hassle
Swiftly convert country codes and cultural terms to all 269 emoji flags without hassle

Swiftly convert country codes and cultural terms to all 269 emoji flags without hassle

A pure Swift library for using ANSI codes. Basically makes command-line coloring and styling very easy!

Colors A pure Swift library for using ANSI codes. Basically makes command-line coloring and styling very easy! Note: Colors master requires Xcode 7.3

The Bloc Pattern is a way to separate UI and Logic in SwiftUI codes;

The Bloc Pattern is a way to separate UI and Logic in SwiftUI codes. The Bloc is like a state machine where it accepts an event and produce a state.

With QRKit you can easily create QR or bar codes in Swift.

With QRKit you can easily create QR or bar codes in Swift. You can choose foreground and background colors. The QR code you get simply as UIImage.

An easy way to access reviews for your app instead of writing repetitive and redundant codes for every app.

AppStoreReviewManager An easy way to access reviews for your app instead of writing repetitive and redundant codes for every app. Requirements iOS 9.0

A pure Swift library for using ANSI codes. Basically makes command-line coloring and styling very easy!

Colors A pure Swift library for using ANSI codes. Basically makes command-line coloring and styling very easy! Note: Colors master requires Xcode 7.3

send your valuable codes here.

Hacktoberfest2021 # Hacktoberfest 2021 Hacktoberfest encourages participation in the open source community, which grows bigger every year. Complete th

A customizable verification code textField. Can be used for phone verification codes, passwords etc
A customizable verification code textField. Can be used for phone verification codes, passwords etc

KKPinCodeTextField A customizable verification code textField. Can be used for phone verification codes, passwords etc. Настраиваемое текстовое поле д

Convert Countries, Country Codes, Continents,... with a single line of code.
Convert Countries, Country Codes, Continents,... with a single line of code.

iOS · macOS · watchOS · tvOS A pure Swift library that allows you to easily convert Countries to Country Codes and Country Codes to Countries. There i

A category on NSString to convert Emoji Cheat Sheet codes to their equivalent Unicode characters

NSString+Emojize A category on NSString to turn codes from Emoji Cheat Sheet into Unicode emoji characters. Getting Started In order to use NSString+E

Releases(0.1.1)
Owner
Chime
Chime
RSA public/private key encryption, private key signing and public key verification in Swift using the Swift Package Manager. Works on iOS, macOS, and Linux (work in progress).

BlueRSA Swift cross-platform RSA wrapper library for RSA encryption and signing. Works on supported Apple platforms (using Security framework). Linux

Kitura 122 Dec 16, 2022
A customisable view for entering arbitrary length pins, codes or passwords in iOS. Supports iOS 12 one time codes.

CBPinEntryView CBPinEntryView is a view written in Swift to allow easy and slick entry of pins, codes or passwords. It allows backspacing, dismissal o

Chris Byatt 183 Dec 5, 2022
CHIOTPField is a set of textfields that can be used for One-time passwords, SMS codes, PIN codes, etc. Mady by @ChiliLabs - https://chililabs.io

CHIOTPField CHIOTPField is a set of textfields that can be used for One-time passwords, SMS codes, PIN codes, etc. All fields support insertion of one

Chili Labs 241 Dec 13, 2022
AppKitFocusOverlay - Add hotkey(s) to display the key focus path for any window in your (running) AppKit application

AppKitFocusOverlay A simple package for displaying the current focus target path

Darren Ford 42 Dec 2, 2022
Carbon🚴 A declarative library for building component-based user interfaces in UITableView and UICollectionView.

A declarative library for building component-based user interfaces in UITableView and UICollectionView. Declarative Component-Based Non-Destructive Pr

Ryo Aoyama 1.2k Jan 5, 2023
Core Data Generator (CDG for short) is a framework for generation (using Sourcery) of Core Data entities from plain structs/classes/enums.

Core Data Generator Introduction Features Supported platforms Installation CDG Setup RepositoryType ModelType DataStoreVersion MigrationPolicy Basic U

Lotusflare 18 Sep 19, 2022
Compose views using enums swiftly: `let label: UILabel = [.text("Hello"), .textColor(.red)]`

ViewComposer Style views using an enum array with its attributes: let label: UILabel = [.text("Hello World"), .textColor(.red)] Table of Contents Inst

Alexander Cyon 28 Jul 5, 2022
An elegant, fast, thread-safe, multipurpose key-value storage, compatible with all Apple platforms.

KeyValueStorage An elegant, fast, thread-safe, multipurpose key-value storage, compatible with all Apple platforms. Supported Platforms iOS macOS watc

null 3 Aug 21, 2022
Advanced Catalyst Example with sidebar, list view, SwiftUI detail view, toolbar & AppKit bundle

Advanced Catalyst Example This is an example of a Catalyst app using a three-column layout, with a primary toolbar. It includes topics such as: Drag &

Steven Troughton-Smith 219 Dec 8, 2022
An example of adding a faux notch using AppKit + SwiftUI

faux-notch An example of adding a faux notch using AppKit + SwiftUI What is this? It's a bare-bones example that renders a fake MacBook notch in macOS

Tanner Stokes 2 Nov 14, 2021