⌨️ Add user-customizable global keyboard shortcuts to your macOS app in minutes

Overview
KeyboardShortcuts

This package lets you add support for user-customizable global keyboard shortcuts to your macOS app in minutes. It's fully sandbox and Mac App Store compatible. And it's used in production by Dato, Jiffy, Plash, and Lungo.

I'm happy to accept more configurability and features. PR welcome! What you see here is just what I needed for my own apps.

Requirements

macOS 10.11+

Install

Add https://github.com/sindresorhus/KeyboardShortcuts in the “Swift Package Manager” tab in Xcode.

Usage

First, register a name for the keyboard shortcut.

Constants.swift

import KeyboardShortcuts

extension KeyboardShortcuts.Name {
	static let toggleUnicornMode = Self("toggleUnicornMode")
}

You can then refer to this strongly-typed name in other places.

You will want to make a view where the user can choose a keyboard shortcut.

PreferencesView.swift

import SwiftUI
import KeyboardShortcuts

struct PreferencesView: View {
	var body: some View {
		HStack {
			Text("Toggle Unicorn Mode:")
			KeyboardShortcuts.Recorder(for: .toggleUnicornMode)
		}
	}
}

There's also support for Cocoa instead of SwiftUI.

KeyboardShortcuts.Recorder takes care of storing the keyboard shortcut in UserDefaults and also warning the user if the chosen keyboard shortcut is already used by the system or the app's main menu.

Add a listener for when the user presses their chosen keyboard shortcut.

AppDelegate.swift

import Cocoa
import KeyboardShortcuts

@main
final class AppDelegate: NSObject, NSApplicationDelegate {
	func applicationDidFinishLaunching(_ notification: Notification) {
		KeyboardShortcuts.onKeyUp(for: .toggleUnicornMode) { [self] in
			// The user pressed the keyboard shortcut for “unicorn mode”!
			isUnicornMode.toggle()
		}
	}
}

You can also listen to key down with .onKeyDown()

That's all!

You can find a complete example in the “Example” directory.

You can also find a real-world example in my Plash app.

Cocoa

Use KeyboardShortcuts.RecorderCocoa instead of KeyboardShortcuts.Recorder.

import Cocoa
import KeyboardShortcuts

final class PreferencesViewController: NSViewController {
	override func loadView() {
		view = NSView()

		let recorder = KeyboardShortcuts.RecorderCocoa(for: .toggleUnicornMode)
		view.addSubview(recorder)
	}
}

Localization

This package supports localizations. PR welcome for more!

  1. Fork the repo.
  2. Create a directory that has a name that uses an ISO 639 language code and optional designators, followed by the .lproj suffix. More here.
  3. Create a file named Localizable.strings under the new language directory and then copy the contents of KeyboardShortcuts/Localization/en.lproj/Localizable.strings to the new file that you just created.
  4. Localize and make sure to review your localization multiple times. Check for typos.
  5. Try to find someone that speaks your language to review the translation.
  6. Submit a PR.

API

See the API docs.

Tips

Show a recorded keyboard shortcut in an NSMenuItem

See NSMenuItem#setShortcut.

Dynamic keyboard shortcuts

Your app might need to support keyboard shortcuts for user-defined actions. Normally, you would statically register the keyboard shortcuts upfront in extension KeyboardShortcuts.Name {}. However, this is not a requirement. It's only for convenience so that you can use dot-syntax when calling various APIs (for example, .onKeyDown(.unicornMode) {}). You can create KeyboardShortcut.Name's dynamically and store them yourself. You can see this in action in the example project.

Default keyboard shortcuts

Setting a default keyboard shortcut can be useful if you're migrating from a different package or just making something for yourself. However, please do not set this for a publicly distributed app. Users find it annoying when random apps steal their existing keyboard shortcuts. It’s generally better to show a welcome screen on the first app launch that lets the user set the shortcut.

import KeyboardShortcuts

extension KeyboardShortcuts.Name {
    static let toggleUnicornMode = Self("toggleUnicornMode", default: .init(.k, modifiers: [.command, .option]))
}

FAQ

How is it different from MASShortcut?

This package:

  • Written in Swift with a swifty API.
  • More native-looking UI component.
  • SwiftUI component included.
  • Support for listening to key down, not just key up.
  • Swift Package Manager support.
  • Connect a shortcut to an NSMenuItem.

MASShortcut:

  • More mature.
  • More localizations.

How is it different from HotKey?

HotKey is good for adding hard-coded keyboard shortcuts, but it doesn't provide any UI component for the user to choose their own keyboard shortcuts.

Why is this package importing Carbon? Isn't that deprecated?

Most of the Carbon APIs were deprecated years ago, but there are some left that Apple never shipped modern replacements for. This includes registering global keyboard shortcuts. However, you should not need to worry about this. Apple will for sure ship new APIs before deprecating the Carbon APIs used here.

Does this package cause any permission dialogs?

No.

How can I add an app-specific keyboard shortcut that is only active when the app is?

That is outside the scope of this package. You can either use NSEvent.addLocalMonitorForEvents, NSMenuItem with keyboard shortcut (it can even be hidden), or SwiftUI's View#keyboardShortcut() modifier.

Can you support CocoaPods or Carthage?

No. However, there is nothing stopping you from using Swift Package Manager for just this package even if you normally use CocoaPods or Carthage.

Related

  • Defaults - Swifty and modern UserDefaults
  • Regex - Swifty regular expressions
  • Preferences - Add a preferences window to your macOS app in minutes
  • LaunchAtLogin - Add "Launch at Login" functionality to your macOS app
  • More…
Comments
  • `Recorder` should allow changing the `name` parameter

    `Recorder` should allow changing the `name` parameter

    Summary

    I found that

    KeyboardShortcuts.Recorder(for: shortCut)
    

    If we changed shortCut in swiftUI the shortcutName name in RecorderCocoa will not update. And I think we should also remove escape function in userDefaults when disalbed

    Test Plan

    I edit KeyboardShortcutsExample to a dynamic shortCut name to test this situation.

    Thanks you so much for your code review!

    opened by hank121314 21
  • Runtime error in Shortcut

    Runtime error in Shortcut

    opened by leits 10
  • Fix compatibility with `View#focused()`

    Fix compatibility with `View#focused()`

    Fixes #76

    @godbout The problem was that the recorder needs to prevent initial focus, otherwise it would enter the key recording when the window shows. I previously solved this by preventing it from becoming a key view. That's what prevented focus.

    I'm not really happy with what's in this pull request, but it's the best I could come up with. I'm open to other ideas. I'm also concerned it may break some usage, although it worked fine in the example app and my Dato app.

    You also need a dispatch call on before setting the focus. I think that's a SwiftUI bug and unrelated to this.

    Could you try out this pull request in your app?

    opened by sindresorhus 9
  • Add ability to reset a shortcut

    Add ability to reset a shortcut

    This is a very useful package and the SwiftUI bindings make it a breeze to use. Please also add the ability to reset the shortcuts. I've tried resetting in the UserDefaults.standard directly but it didn't seem to have any effect.

    I see that the code already has this ability, just that it needs to be exposed as a public API, say KeyboardShortcuts.reset(name: Name)

    opened by pavanpodila 7
  • Export/Import - how to implement?

    Export/Import - how to implement?

    In my app, I have some user-defined actions. Let's say this action is a codable struct that I can save as binary data on the disk. I'm planning also to use KeyboardShortcuts so that those actions could be triggered by the shortcut. Is there a way to export and then import those shortcuts attached to the action?

    opened by iSapozhnik 6
  • View Modifier Implementations

    View Modifier Implementations

    @sindresorhus I added an implementation using ViewModifiers to more closely match the syntax.

    I'm not super sure about the API design, because I don't love the name of the functions. Maybe keeping only the implementation of onShortcutEvent but renamed to onShortcut would look cleaner.

    opened by EmilioPelaez 6
  • Support for controlSize(:) and frame(width:) modifier

    Support for controlSize(:) and frame(width:) modifier

    My current app design requires a smaller variant of the text field. Thus, I have implemented a proper support for controlSize(:) that (among others) reflects the font size to the controlSize parameter. Furthermore, changing the text field's width was an important requirements for proper layouting.

    FYI: Please refer to the Previews in Recorder.swift for testings.

    opened by Maschina 6
  • Can't record shortcuts when empty

    Can't record shortcuts when empty

    Describe the bug

    When the current shortcut is cleared and the the box is left empty, it is not possible to record a new shortcut anymore.

    To Reproduce

    • Delete existing shortcut
    • Click outside to deselect recorder field
    • Try to click recorder field again

    Expected behavior

    • A new shortcut should be recordable

    Desktop (please complete the following information)

    • macOS version: Big Sur 11.1
    • KeyboardShortcuts version: 0.7.0
    • Due to backward compatibility I use RecorderCocoa instead of Recorder

    Additional information

    • Clicking Record Shortcut changes to Press shortcut as long as left mouse button is clicked and skips back to Record shortcut after mouse button release.
    • When double clicking Record Shortcut field it changes to Press shortcut, but does not allow any combinations, only plain single letters. But the x button will appear again.
    opened by adur1990 6
  • Disable all shortcuts and then re-enable them

    Disable all shortcuts and then re-enable them

    There should be a way to disable all shortcuts and then re-enable them. This is useful on a Preferences screen where you are registering a bunch of shortcuts. While you are entering new shortcuts, you should not be able to invoke the global shortcuts, especially when the control has focus.

    Currently there is no way to disable global hotkey monitoring.

    opened by pavanpodila 6
  • userDefaultsRemove uses removeObject

    userDefaultsRemove uses removeObject

    At present userDefaultsRemove is setting the value to false. For my specifc case, where a lot of dynamic keys are used, I noticed a lot of stale keys in UserDefaults. I think it's best to remove the key

    opened by kaunteya 5
  • KeyboardShortcuts doesn't work when appsandbox is removed

    KeyboardShortcuts doesn't work when appsandbox is removed

    Hello, I've tested your library on Xcode that works perfectly when App sandbox is enabled under Signing & Capabilities tab, but as soon as I removed App sandbox, keyboard shortcuts doesn't work(I don't see any errors in the library though).

    My question, is App sandbox necessary to make it work?

    More information,

    • I've registered keys using Recorder method
    • My app's use-case requires me to remove sandbox(so I've no choice here to enable it)

    Any help is highly appreciated 🙏

    opened by pradeepb28 5
  • Update Localizable.strings keyboard_shortcuts_can_be_changed for Ventura

    Update Localizable.strings keyboard_shortcuts_can_be_changed for Ventura

    For users on Ventura, instructions for how to change an existing system-wide shortcut are a bit different since System Preferences has been renamed to System Settings and the Shortcuts has been modified a bit as well.

    "keyboard_shortcuts_can_be_changed" = "Most system-wide keyboard shortcuts can be changed in “System Preferences › Keyboard › Shortcuts”.";

    should become:

    "keyboard_shortcuts_can_be_changed" = "Most system-wide keyboard shortcuts can be changed in “System Settings › Keyboard › Keyboard Shortcuts…”.";

    opened by stammy 8
  • Improve docs

    Improve docs

    • [ ] remove nodocs comments
    • [ ] find out if DocC has a way to hide properties
    • [ ] Move readme docs to DocC: https://github.com/SwiftPackageIndex/SwiftPackageIndex-Server/discussions/2133#discussioncomment-4127489

    https://developer.apple.com/documentation/xcode/adding-structure-to-your-documentation-pages

    https://developer.apple.com/documentation/xcode/adding-supplemental-content-to-a-documentation-catalog

    https://developer.apple.com/documentation/xcode/formatting-your-documentation-content

    opened by sindresorhus 0
  • Use a popover instead of modal dialog for keyboard shortcut validation message

    Use a popover instead of modal dialog for keyboard shortcut validation message

    When the keyboard shortcut is taken by the system or the app. I don't think it's useful for those to be modal. The user should be able to easily continue afterward.

    enhancement help wanted 
    opened by sindresorhus 0
Releases(v1.9.1)
  • v1.9.1(Dec 13, 2022)

    • Remove the UserDefaults key for a shortcut completely if the default parameter on Name is not used

    https://github.com/sindresorhus/KeyboardShortcuts/compare/v1.9.0...v1.9.1

    Source code(tar.gz)
    Source code(zip)
  • v1.9.0(Oct 29, 2022)

    • Fix using the recorder in a popover
    • Allow clicking controls outside the recorder input directly when the recorder is focused
    • Update more localizations for macOS 13
    • Add French and Dutch localization

    Xcode 14.1 or later is required

    https://github.com/sindresorhus/KeyboardShortcuts/compare/v1.8.0...v1.9.0

    Source code(tar.gz)
    Source code(zip)
  • v1.8.0(Oct 20, 2022)

    • Improve compatibility with macOS 13
    • Drop support for macOS 10.11 and 10.12 (Xcode doesn't support these anymore)
    • Fix text field getting initial focus

    Xcode 14.1 is now required

    https://github.com/sindresorhus/KeyboardShortcuts/compare/v1.7.2...v1.8.0

    Source code(tar.gz)
    Source code(zip)
  • v1.7.2(Aug 19, 2022)

  • v1.7.1(Jun 26, 2022)

    • Fix duplication checking with menu items for shortcuts with a Shift modifier

    https://github.com/sindresorhus/KeyboardShortcuts/compare/v1.7.0...v1.7.1

    Source code(tar.gz)
    Source code(zip)
  • v1.7.0(Jun 6, 2022)

    • Fix compatibility with SwiftUI.View#focused() https://github.com/sindresorhus/KeyboardShortcuts/commit/387756ce61cd5c7a27a6e2f5b611db593d60c59e
    • Add Arabic localization https://github.com/sindresorhus/KeyboardShortcuts/commit/660c11ee4d30f3df50a546a6cd1b6a56376796d4

    https://github.com/sindresorhus/KeyboardShortcuts/compare/v1.6.0...v1.7.0

    Source code(tar.gz)
    Source code(zip)
  • v1.6.0(May 3, 2022)

    • The previous version introduced a .on() method. This method has been renamed to .events() to better reflect Apple's naming of async stream APIs. An automatic "fix-it" is included. https://github.com/sindresorhus/KeyboardShortcuts/commit/8a2cc9130b0eec6e1dae0a9a405a17741437caa5
    • Added View#onKeyboardShortcut() method to make it nicer to listen to keyboard shortcut events in SwiftUI. https://github.com/sindresorhus/KeyboardShortcuts/commit/8a2cc9130b0eec6e1dae0a9a405a17741437caa5#diff-02bed2a7d5a7f8e2e4644c05f55d36c4c037107a949ef792d8405460f4d0ee3cR1-R38
    • Update localization zh-TW to align with Apple's https://github.com/sindresorhus/KeyboardShortcuts/commit/ee60fcf3fc2f017cf7c60d6063e64be64748cef6

    https://github.com/sindresorhus/KeyboardShortcuts/compare/v1.5.0...v1.6.0

    Source code(tar.gz)
    Source code(zip)
  • v1.5.0(Mar 30, 2022)

    • Add support for specifying a label in KeyboardShortcuts.Recorder https://github.com/sindresorhus/KeyboardShortcuts/commit/7e251f3a15234fb126f969040ec407ad45701efd
      • This means you no longer need to wrap it in a HStack yourself.
    • Add modern AsyncStream-based key listener method https://github.com/sindresorhus/KeyboardShortcuts/commit/0dcedd56994d871f243f3d9c76590bfd9f8aba69
      • The benefit of this one over onKeyUp() is that you can control its lifecycle. When you cancel the stream, the listening ends.
    • Add Czech localization https://github.com/sindresorhus/KeyboardShortcuts/commit/954285d111808f5b2717e4acc8088ada2bbfabfc

    https://github.com/sindresorhus/KeyboardShortcuts/compare/v1.4.0...v1.5.0

    Source code(tar.gz)
    Source code(zip)
  • v1.4.0(Jan 23, 2022)

  • v1.3.0(Oct 3, 2021)

    • Add Chinese (Traditional, Taiwan) localization https://github.com/sindresorhus/KeyboardShortcuts/commit/32aef044a7705bbc70508c0fb1731cf57d11b7f4

    https://github.com/sindresorhus/KeyboardShortcuts/compare/v1.2.1...v1.3.0

    Source code(tar.gz)
    Source code(zip)
  • v1.2.1(Sep 11, 2021)

    • Don't allow “shift” key without other modifiers or function key https://github.com/sindresorhus/KeyboardShortcuts/commit/7030a2e3d46100585f9c5c6a2fe3bae9f6e78fa8

    https://github.com/sindresorhus/KeyboardShortcuts/compare/v1.2.0...v1.2.1

    Source code(tar.gz)
    Source code(zip)
  • v1.2.0(Jun 7, 2021)

    • Add German localization (#49) https://github.com/sindresorhus/KeyboardShortcuts/commit/701e1545b70ca2ede96751a36a5ea4fc830c6ff4
    • Allow using F12 as a shortcut https://github.com/sindresorhus/KeyboardShortcuts/commit/a7a3ff6248b7564ef4ef2e9003672bf1b9f77ad1

    https://github.com/sindresorhus/KeyboardShortcuts/compare/v1.1.0...v1.2.0

    Source code(tar.gz)
    Source code(zip)
  • v1.1.0(Apr 18, 2021)

  • v1.0.0(Mar 23, 2021)

    Breaking

    • Drop support for CocoaPods and Carthage. It turned out to be too much of a hassle to support these while also supporting localization. If you use CocoaPods or Carthage, there's nothing stopping you from continuing using CocoaPods/Carthage for other packages while using Swift Package Manager for this package. See install instructions in the readme.

    Improvements

    • This package is now considered stable.
    • Support for localization. https://github.com/sindresorhus/KeyboardShortcuts/commit/7535969a908eb7653ba7213aa2fe2f381aaa9e0f Currently, only English and Chinese, but pull request welcome for more.

    https://github.com/sindresorhus/KeyboardShortcuts/compare/v0.7.1...v1.0.0

    Source code(tar.gz)
    Source code(zip)
  • v0.7.1(Feb 21, 2021)

    • Fix RecorderCocoa when embedded in certain views (#43). https://github.com/sindresorhus/KeyboardShortcuts/commit/1d53dae13115e9fa728caca761226a0d9db50664

    https://github.com/sindresorhus/KeyboardShortcuts/compare/v0.7.0...v0.7.1

    Source code(tar.gz)
    Source code(zip)
  • v0.7.0(Jan 31, 2021)

    • Support for setting NSMenuItem shortcut with nameless shortcut (#38) https://github.com/sindresorhus/KeyboardShortcuts/commit/428ee65cde20349add385dfbf057e2e0b5445451

    https://github.com/sindresorhus/KeyboardShortcuts/compare/v0.6.1...v0.7.0

    Source code(tar.gz)
    Source code(zip)
  • v0.6.1(Jan 11, 2021)

    • Add method to remove all handlers (#36) https://github.com/sindresorhus/KeyboardShortcuts/commit/d8a9321c4a2c39363b7c1d57d86d8d24f7f5cfc1

    https://github.com/sindresorhus/KeyboardShortcuts/compare/v0.6.0...v0.6.1

    Source code(tar.gz)
    Source code(zip)
  • v0.6.0(Oct 9, 2020)

    • Recorder should allow changing the name parameter https://github.com/sindresorhus/KeyboardShortcuts/commit/a6c093057d7172d52db5fe1e0552066f0f1285bb (#26)

    https://github.com/sindresorhus/KeyboardShortcuts/compare/v0.5.0...v0.6.0

    Source code(tar.gz)
    Source code(zip)
  • v0.5.0(Aug 28, 2020)

    • Add .setShortcut(), .getShortcut(), and .reset() methods https://github.com/sindresorhus/KeyboardShortcuts/commit/43d7fe58b3a90cfd1a085ff21daa5cbf8abed5af
    • Pause keyboard shortcut events while a recorder input is active (#25) https://github.com/sindresorhus/KeyboardShortcuts/commit/729002c51aa1269964f9ac9924abdefa4309a6bb

    https://github.com/sindresorhus/KeyboardShortcuts/compare/v0.4.0...v0.5.0

    Source code(tar.gz)
    Source code(zip)
  • v0.4.0(Jul 25, 2020)

    Breaking

    • Remove Name typealias in KeyboardShortcuts.Name https://github.com/sindresorhus/KeyboardShortcuts/commit/a345f5f2412fbff3805be4a5c007fa7f8e7da7af You can just use Self instead.

    Improvements

    • Fix building on Apple Silicon https://github.com/sindresorhus/KeyboardShortcuts/commit/3c5fcbfb92b75a1f8b1332fd2232192ea8580725

    https://github.com/sindresorhus/KeyboardShortcuts/compare/v0.3.0...v0.4.0

    Source code(tar.gz)
    Source code(zip)
  • v0.3.0(Jun 22, 2020)

    • Add optional change callback to Recorder and RecorderCocoa (#12) https://github.com/sindresorhus/KeyboardShortcuts/commit/5cb615fbca59561817664f33abb45bb509217c1d
    • Add the ability to set default shortcut (#13) https://github.com/sindresorhus/KeyboardShortcuts/commit/827153770709ff9103a7742c0eddeecf017fde00

    https://github.com/sindresorhus/KeyboardShortcuts/compare/v0.2.2...v0.3.0

    Source code(tar.gz)
    Source code(zip)
  • v0.2.2(Jun 8, 2020)

    • Unregister shortcut before setting a new one (#10) https://github.com/sindresorhus/KeyboardShortcuts/commit/56778e11a762931feebbdb726269ddf3919bc084

    https://github.com/sindresorhus/KeyboardShortcuts/compare/v0.2.1...v0.2.2

    Source code(tar.gz)
    Source code(zip)
  • v0.2.1(Jun 5, 2020)

    • Fix .setShortcut() crashing when called from a NSBackgroundActivityScheduler task https://github.com/sindresorhus/KeyboardShortcuts/commit/eb68608e7f2a98cc4b64f3361de61c1991d9a842 This looks like a macOS/Xcode bug and it only happens when running from Xcode, not in archived builds, even debug builds.

    https://github.com/sindresorhus/KeyboardShortcuts/compare/v0.2.0...v0.2.1

    Source code(tar.gz)
    Source code(zip)
  • v0.2.0(May 19, 2020)

    • Add method to show a keyboard shortcut in NSMenuItem (#5) https://github.com/sindresorhus/KeyboardShortcuts/commit/9c0427adcb3762c4b0e4460296ec73955f885875

    https://github.com/sindresorhus/KeyboardShortcuts/compare/v0.1.1...v0.2.0

    Source code(tar.gz)
    Source code(zip)
  • v0.1.1(May 9, 2020)

    • Cancel recording when the user clicks outside the input https://github.com/sindresorhus/KeyboardShortcuts/commit/8e7291f441174ad97b9b175e4c961c00912b8858
    • Fix the Key type https://github.com/sindresorhus/KeyboardShortcuts/commit/4dac01938699278a3dedfa518e50522809b4eb24

    https://github.com/sindresorhus/KeyboardShortcuts/compare/v0.1.0...v0.1.1

    Source code(tar.gz)
    Source code(zip)
  • v0.1.0(May 7, 2020)

Owner
Sindre Sorhus
Full-Time Open-Sourcerer. Wants more empathy & kindness in open source. Focuses on Swift & JavaScript. Makes macOS apps, CLI tools, npm packages. Likes unicorns
Sindre Sorhus
Slidden is an open source, customizable, iOS 8 keyboard, written in Swift

Slidden is an open source, customizable, iOS 8 keyboard, written in Swift. iOS 8 brought us the ability to create fully customizable keyboards, but do

Daniel Brim 595 Jan 5, 2023
QMK Agent is a macOS menubar application which sends commands to a QMK enabled keyboard

QMKagent QMK Agent is a macOS menubar application which sends commands to a QMK enabled keyboard Features System volume indicator using top row (Esc t

Mike Killewald 4 Apr 24, 2022
IHKeyboardAvoiding is an elegant solution for keeping any UIView visible when the keyboard is being shown - no UIScrollView required!

IHKeyboardAvoiding An elegant solution for keeping any UIView visible when the keyboard is being shown Requirements IHKeyboardAvoiding Version Objecti

Idle Hands Apps 1.4k Dec 14, 2022
Codeless drop-in universal library allows to prevent issues of keyboard sliding up and cover UITextField/UITextView. Neither need to write any code nor any setup required and much more.

IQKeyboardManager While developing iOS apps, we often run into issues where the iPhone keyboard slides up and covers the UITextField/UITextView. IQKey

Mohd Iftekhar Qurashi 15.9k Jan 8, 2023
Codeless manager to hide keyboard by tapping on views for iOS written in Swift

KeyboardHideManager KeyboardHideManager - codeless manager to hide keyboard by tapping on views for iOS written in Swift. Structure Features Requireme

Bondar Yaroslav 55 Oct 19, 2022
Swift UIKit keyboard manager for iOS apps.

Typist Typist is a small, drop-in Swift UIKit keyboard manager for iOS apps. It helps you manage keyboard's screen presence and behavior without notif

Toto Tvalavadze 1.1k Dec 10, 2022
Suppress mouse & keyboard events on MacOSX. Baby-proof my Mac!

Suppress mouse & keyboard events on MacOSX Catches all events (mouse, keyboard, everything), and either consumes them (locked state) or passes them th

Albert Zeyer 6 Oct 21, 2022
KeyboardKit is a Swift library that helps you create custom keyboard extensions for iOS and ipadOS.

KeyboardKit is a Swift library that helps you create custom keyboard extensions for iOS and ipadOS.

KeyboardKit 900 Jan 9, 2023
Best way to dismiss Keyboard in a View Controller iOS (Swift)

Best way to dismiss Keyboard in a View Controller iOS (Swift) First way: Implement UITextFieldDelegate’s textFieldShouldReturn method and dismiss curr

null 0 Dec 18, 2021
Showing / dismissing keyboard animation in simple UIViewController category.

RSKKeyboardAnimationObserver Easy way to handle iOS keyboard showing/dismissing. Introduction Working with iOS keyboard demands a lot of duplicated co

Ruslan Skorb 45 Jun 9, 2022
Objective-C library for tracking keyboard in iOS apps.

NgKeyboardTracker Objective-c library for tracking keyboard in iOS apps. Adding to your project If you are using CocoaPods, add to your Podfile: pod '

Meiwin Fu 808 Nov 17, 2022
A simple keyboard to use with numbers and, optionally, a decimal point.

MMNumberKeyboard A simple keyboard to use with numbers and, optionally, a decimal point. Installation From CocoaPods CocoaPods is a dependency manager

Matías Martínez 957 Nov 17, 2022
For less complicated keyboard event handling.

KeyboardObserver For less complicated keyboard event handling. Features Less complicated keyboard event handling. Do not use Notification , but event

Morita Naoki 163 May 24, 2022
A drop-in universal solution for moving text fields out of the way of the keyboard in iOS

TPKeyboardAvoiding A drop-in universal solution for moving text fields out of the way of the keyboard in iOS. Introduction There are a hundred and one

Michael Tyson 5.8k Dec 26, 2022
KeyboardMan helps you to make keyboard animation.

KeyboardMan We may need keyboard infomation from keyboard notifications to do animation. However, the approach is complicated and easy to make mistake

null 353 Apr 19, 2022
Emoji Keyboard SDK (iOS)

Makemoji SDK Makemoji is a free emoji keyboard for mobile apps. By installing our keyboard SDK every user of your app will instantly have access to ne

Makemoji 100 Nov 3, 2022
A Chinese keyboard for iOS that helps Chinese language learners remember tones.

ToneBoard ToneBoard is a Chinese keyboard for iOS that requires you to enter the correct tones while typing simplified Chinese with Pinyin. It is avai

Kevin Bell 7 Sep 27, 2022
SwiftyKeyboard: a full customized numeric keyboard for iOS

SwiftyKeyboard Overview SwiftyKeyboard is an iOS customized enhanced keyboard. T

SwiftyKit 2 Jun 30, 2022
Interactive Keyboard Controller for Swift

Keynode Why Using UIScrollViewKeyboardDismissMode added in iOS7, interactive keyboard operation became possible. But, it only works on UIScrollView. K

Kyohei Ito 76 Sep 1, 2020