Skip to content

KeyboardKit helps you create custom keyboards for iOS and iPadOS.

License

Notifications You must be signed in to change notification settings

xurxogp/KeyboardKit

 
 

Repository files navigation

KeyboardKit Logo

Version Swift 5.6 MIT License Twitter: @@getkeyboardkit Mastodon: @keyboardkit@techhub.social

About KeyboardKit

KeyboardKit helps you create custom keyboards for iOS and iPadOS, using Swift and SwiftUI. It extends Apple's native keyboard APIs and provides you with more functionality.

KeyboardKit lets you create keyboards that mimic native iOS keyboards in a few lines of code.

These keyboards can be customized to change input keys, layout, design, behavior etc. You can also use completely custom views.

Installation

KeyboardKit can be installed with the Swift Package Manager:

https://github.com/KeyboardKit/KeyboardKit.git

KeyboardKit supports iOS 14, macOS 11, tvOS 14 and watchOS 7, although some features are unavailable on some platforms.

Supported Locales

KeyboardKit is localized in 60+ keyboard-specific locales:

🇦🇱 🇦🇪 🇦🇲 🇧🇾 🇧🇬 🇦🇩 🏳️ 🇭🇷 🇨🇿 🇩🇰
🇳🇱 🇧🇪 🇺🇸 🇬🇧 🇺🇸 🇪🇪 🇫🇴 🇵🇭 🇫🇮 🇫🇷
🇧🇪 🇨🇭 🇬🇪 🇩🇪 🇦🇹 🇨🇭 🇬🇷 🇺🇸 🇮🇱 🇭🇺
🇮🇸 🇮🇩 🇮🇪 🇮🇹 🇰🇿 🇹🇯 🇹🇯 🇹🇯 🇱🇻 🇱🇹
🇲🇰 🇲🇾 🇲🇹 🇲🇳 🇳🇴 🇮🇷 🇵🇱 🇵🇹 🇧🇷 🇷🇴
🇷🇺 🇷🇸 🇷🇸 🇸🇰 🇸🇮 🇪🇸 🇰🇪 🇸🇪 🇹🇷 🇺🇦
🇺🇿

KeyboardKit comes with basic input sets, layouts and secondary callout actions.

Features

KeyboardKit comes packed features to help you build amazing and powerful keyboards:

  • ⌨️ Essentials - KeyboardKit comes with a bunch of essential features and types.
  • 💥 Actions - KeyboardKit has keyboard actions like characters, actions, etc.
  • 🤖 AI Support - KeyboardKit has capabilities that are needed for AI.
  • 💡 Autocomplete - KeyboardKit can perform autocomplete and autocorrect.
  • 🔤 Buttons - KeyboardKit can style any view as a keyboard button.
  • 🗯 Callouts - KeyboardKit can show input and secondary callouts.
  • 🌈 Colors - KeyboardKit defines a bunch of keyboard-related colors.
  • 📱 Device Utilities - KeyboardKit has a bunch of device-specific utilities.
  • 🎤 Dictation (BETA) - KeyboardKit can perform dictation from the keyboard.
  • 😀 Emojis - KeyboardKit defines an emoji type with a lot of information.
  • 🔉 Feedback - KeyboardKit can trigger audio and haptic feedback.
  • 👆 Gestures - KeyboardKit has rich, keyboard-specific gestures.
  • 🖼️ Images - KeyboardKit defines a bunch of keyboard-related images.
  • 🔣 Layout - KeyboardKit defines dynamic input sets and keyboard layouts.
  • 🌐 Localization - KeyboardKit supports 60+ locales.
  • 🗺️ Navigation - KeyboardKit lets you open urls and other apps.
  • 👁 Previews - KeyboardKit lets you preview views and components in SwiftUI.
  • ➡️ Proxy Extensions - KeyboardKit makes UITextDocumentProxy do a LOT more.
  • ⚙️ Settings - KeyboardKit has a bunch of settings tools.
  • 🩺 State - KeyboardKit lets you detect if a keyboard is enabled, has full access, etc.
  • 🎨 Styling - KeyboardKit lets you style your keyboards to great extent.
  • 🚏 Text Routing - KeyboardKit kan route text to other places.

KeyboardKit Pro extends these features with many pro features, such as fully localized keyboards, autocomplete, emoji keyboards, dictation, etc.

Getting Started

The online documentation has a getting-started guide that helps you get started with KeyboardKit.

After installing KeyboardKit, just import KeyboardKit and make your KeyboardViewController inherit KeyboardInputViewController instead of UIInputViewController:

import KeyboardKit

class KeyboardController: KeyboardInputViewController {}

This gives your controller access to new lifecycle functions, observable state, services, and much more.

KeyboardKit will by default use a standard SystemKeyboard. If you just want to use this standard view, you don’t have to do anything more.

To customize or replace the standard view, you can override viewWillSetupKeyboard() and call any of the setup functions with a custom view:

class KeyboardViewController: KeyboardInputViewController {

    override func viewWillSetupKeyboard() {
        super.viewWillSetupKeyboard()
        setup { controller in
            SystemKeyboard(
                state: controller.state,
                services: controller.services,
                buttonContent: { $0.view },
                buttonView: { $0.view },
                emojiKeyboard: { $0.view },
                toolbar: { _ in MyCustomToolbar() }
            )
        }
    }
}

The setup view builder provides an unowned controller reference to help avoiding memory leaks. Use it to access its state and services, and avoid passing it around.

For more information, please see the online documentation and getting-started guide.

Documentation

The online documentation has articles, code examples etc.

KeyboardKit Pro

KeyboardKit Pro extends KeyboardKit with a lot of Pro features, such as localized keyboards and services, autocomplete, dictation, pro emoji features (keyboards, categories, versions, skintones, etc).

KeyboardKit Pro lets you create fully localized keyboards with a single line of code.

Demo App

The KeyboardKit repository has a demo app that shows how to display keyboard state, link to system settings, etc.

The demo app has three keyboards:

  • Keyboard uses KeyboardKit and a standard SystemKeyboard.
  • KeyboardPro uses KeyboardKit Pro and a SystemKeyboard with 60+ locales, autocomplete, etc.
  • KeyboardTextInput uses KeyboardKit Pro and lets you test using text input within the keyboard.

Just open and run the demo app in the Demo folder, then enable the keyboards under System Settings. Note that you need to enable full access for some features, like haptic feedback.

KeyboardKit App

If you want to try KeyboardKit Pro without having to write any code or build the demo app from Xcode, there is a [KeyboardKit app][app-store] in the App Store.

Support this project

KeyboardKit is open-source and completely free, but you can sponsor this project on GitHub Sponsors, upgrade to KeyboardKit Pro or get in touch for freelance work, paid support etc.

Contact

Feel free to reach out if you have questions or if you want to contribute in any way:

License

KeyboardKit is available under the MIT license. See the LICENSE file for more info.

About

KeyboardKit helps you create custom keyboards for iOS and iPadOS.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Swift 99.6%
  • Other 0.4%