Code Monkey home page Code Monkey logo

keyboardkit's Introduction

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 the native iOS keyboards in a few lines of code. These keyboards can be customized to change input keys, layout, design, behavior etc.

KeyboardKit also lets you use completely custom views together with the features that the library provides. Most of the library can be used on all major Apple platforms.

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

Installation

KeyboardKit can be installed with the Swift Package Manager:

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

You can add the library to the main app, the keyboard extension and any other targets that need it. If you prefer to not have external dependencies, you can also just copy the source code into your app.

Supported Locales

KeyboardKit is localized in 60+ keyboard-specific locales:

๐Ÿ‡ฆ๐Ÿ‡ฑ ๐Ÿ‡ฆ๐Ÿ‡ช ๐Ÿ‡ฆ๐Ÿ‡ฒ ๐Ÿ‡ง๐Ÿ‡พ ๐Ÿ‡ง๐Ÿ‡ฌ ๐Ÿ‡ฆ๐Ÿ‡ฉ ๐Ÿณ๏ธ ๐Ÿ‡ญ๐Ÿ‡ท ๐Ÿ‡จ๐Ÿ‡ฟ ๐Ÿ‡ฉ๐Ÿ‡ฐ
๐Ÿ‡ณ๐Ÿ‡ฑ ๐Ÿ‡ง๐Ÿ‡ช ๐Ÿ‡บ๐Ÿ‡ธ ๐Ÿ‡ฌ๐Ÿ‡ง ๐Ÿ‡บ๐Ÿ‡ธ ๐Ÿ‡ช๐Ÿ‡ช ๐Ÿ‡ซ๐Ÿ‡ด ๐Ÿ‡ต๐Ÿ‡ญ ๐Ÿ‡ซ๐Ÿ‡ฎ ๐Ÿ‡ซ๐Ÿ‡ท
๐Ÿ‡ง๐Ÿ‡ช ๐Ÿ‡จ๐Ÿ‡ญ ๐Ÿ‡ฌ๐Ÿ‡ช ๐Ÿ‡ฉ๐Ÿ‡ช ๐Ÿ‡ฆ๐Ÿ‡น ๐Ÿ‡จ๐Ÿ‡ญ ๐Ÿ‡ฌ๐Ÿ‡ท ๐Ÿ‡บ๐Ÿ‡ธ ๐Ÿ‡ฎ๐Ÿ‡ฑ ๐Ÿ‡ญ๐Ÿ‡บ
๐Ÿ‡ฎ๐Ÿ‡ธ ๐Ÿ‡ฎ๐Ÿ‡ฉ ๐Ÿ‡ฎ๐Ÿ‡ช ๐Ÿ‡ฎ๐Ÿ‡น ๐Ÿ‡ฐ๐Ÿ‡ฟ ๐Ÿ‡น๐Ÿ‡ฏ ๐Ÿ‡น๐Ÿ‡ฏ ๐Ÿ‡น๐Ÿ‡ฏ ๐Ÿ‡ฑ๐Ÿ‡ป ๐Ÿ‡ฑ๐Ÿ‡น
๐Ÿ‡ฒ๐Ÿ‡ฐ ๐Ÿ‡ฒ๐Ÿ‡พ ๐Ÿ‡ฒ๐Ÿ‡น ๐Ÿ‡ฒ๐Ÿ‡ณ ๐Ÿ‡ณ๐Ÿ‡ด ๐Ÿ‡ฎ๐Ÿ‡ท ๐Ÿ‡ต๐Ÿ‡ฑ ๐Ÿ‡ต๐Ÿ‡น ๐Ÿ‡ง๐Ÿ‡ท ๐Ÿ‡ท๐Ÿ‡ด
๐Ÿ‡ท๐Ÿ‡บ ๐Ÿ‡ท๐Ÿ‡ธ ๐Ÿ‡ท๐Ÿ‡ธ ๐Ÿ‡ธ๐Ÿ‡ฐ ๐Ÿ‡ธ๐Ÿ‡ฎ ๐Ÿ‡ช๐Ÿ‡ธ ๐Ÿ‡ฐ๐Ÿ‡ช ๐Ÿ‡ธ๐Ÿ‡ช ๐Ÿ‡น๐Ÿ‡ท ๐Ÿ‡บ๐Ÿ‡ฆ
๐Ÿ‡บ๐Ÿ‡ฟ

KeyboardKit comes with localized input sets, layouts and callouts for U.S. English.

Features

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

  • ๐Ÿ’ฅ Actions - KeyboardKit has keyboard actions like characters, emojis, actions, etc.
  • ๐Ÿ’ก Autocomplete - KeyboardKit can perform autocomplete and present suggestions as the user types.
  • ๐Ÿ—ฏ Callouts - KeyboardKit can show input and secondary action callouts.
  • ๐ŸŽค Dictation - (BETA) KeyboardKit can perform dictation from the keyboard extension.
  • ๐Ÿ˜Š Emojis - KeyboardKit defines emojis and emoji categories, as well as emoji keyboards.
  • โŒจ๏ธ External Keyboards - KeyboardKit lets you detect whether or not an external keyboard is connected.
  • ๐Ÿ‘‹ Feedback - KeyboardKit keyboards can give and haptic feedback feedback as the user types.
  • ๐Ÿ‘† Gestures - KeyboardKit has keyboard-specific gestures that you can use in your own keyboards.
  • โŒจ๏ธ Keyboard - KeyboardKit supports different keyboard types, provides observable keyboard state, etc.
  • ๐Ÿ”ฃ Layout - KeyboardKit supports creating keyboard layouts for various devices, locales etc.
  • ๐ŸŒ Localization- KeyboardKit supports LTR and RTL locales with localized content and assets.
  • ๐Ÿ‘ Previews - KeyboardKit has utilites that help previewing keyboard views and components in SwiftUI.
  • โžก๏ธ Proxy Extensions - KeyboardKit extends UITextDocumentProxy and makes it do a lot more.
  • ๐Ÿš Routing - KeyboardKit lets you route text to other destinations than the main app.
  • โš™๏ธ Settings - KeyboardKit has tools for accessing and linking to an app's keyboard settings.
  • ๐ŸŽจ Styling - KeyboardKit has a style engine that lets you style your keyboards to great extent.

Getting Started

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

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 additional functionality, such as new lifecycle functions like viewWillSetupKeyboard(), observable state like keyboardContext, services like keyboardActionHandler and much more.

The default KeyboardInputViewController behavior is to setup an English SystemKeyboard. It will then call viewWillSetupKeyboard() when the keyboard view should be created or updated.

To set up KeyboardKit with a custom view, you can override viewWillSetupKeyboard() and call .setup(with:) to customize the SystemKeyboard or use a custom view:

class KeyboardViewController: KeyboardInputViewControllerย {

    func viewWillSetupKeyboard() {
        super.viewWillSetupKeyboard()
        setup { controller in
            VStack(spacing: 0) {
                MyCustomToolbar()
                SystemKeyboard(
                    controller: controller,
                    autocompleteToolbar: .none
                )
            }
        }
    }
}

The view builder provides an unowned controller reference to avoid reference cycles and memory leaks.

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

Documentation

The online documentation has articles, code examples etc. that let you overview the various parts of the library and understand how they all connect to each other.

The online documentation is currently iOS-specific. To generate documentation for the other platforms, open the package in Xcode, select a simulator then run Product/Build Documentation.

KeyboardKit Pro

KeyboardKit Pro extends KeyboardKit with pro features, such as localized keyboards and services, autocomplete, dictation, emoji skintones, additional views etc. It lets you create fully localized keyboards with a single line of code.

App Store Application

If you want to try out KeyboardKit without having to write any code, there is a [KeyboardKit app][app-store] in the App Store, that lets you try out KeyboardKit and many of its features.

The App Store app uses KeyboardKit Pro to provide support for 60+ locales, autocomplete, dictation, emoji skintones etc.

Demo Application

This project has a demo app that lets you try out KeyboardKit and KeyboardKit Pro.

  • The main app shows how to display keyboard state, link to system settings, etc.
  • The English keyboard uses KeyboardKit and a SystemKeyboard with a standard, English locale.
  • The Unicode keyboard uses KeyboardKit and a SystemKeyboard with unicode-based input keys.
  • The Custom keyboard uses KeyboardKit and a SystemKeyboard with custom keys, layouts and styles.
  • The Pro keyboard uses KeyboardKit Pro and a SystemKeyboard with all LRT locales, autocomplete etc.

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

Support

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.

keyboardkit's People

Contributors

danielsaidi avatar digitalheir avatar ardavank avatar brennanium avatar amirshane avatar f-person avatar danielpunkass avatar ibayramli avatar wearhere avatar pvinis avatar alfredcc avatar andrewtavis avatar antonito avatar sirheimer avatar gonzalonunez avatar jackhumbert avatar jkristell avatar krizhanovskii avatar micazeve avatar mirasaujan avatar skellock avatar vuong-dao avatar luffy-yu avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.