Coder Social home page Coder Social logo

bluetooth-keyboard-emulator's Introduction

Bluetooth Keyboard Emulator

Swift Bluetooth HID Keyboard Emulator

After the release of macOS Catalina (10.15), I‘m unable to pair devices and publish HID services using Bluetooth Classic. 🤷‍♂️

Bluetooth LE (Low Energy) as provided by the “Core Bluetooth” APIs explicitly disallows publishing HID GATT service (0x1812) since macOS ~10.11.

How to Use

  • Run the Xcode project

From your phone/tablet:

  • Go to Bluetooth settings
  • If already paired with desktop, then "Forget the Device"
  • Connect to your dekstop.
  • Start Typing!

Source Files

  • BTKeyboard.swift

    Creates a Bluetooth SDP service using SerialPortDictionary.plist and listens for incoming connections.

  • KeyCodes.swift

    Converts virtual key codes (the number assigned to keys according NSEvent) to HID key codes (as specified in the USB specification).

  • AppDelegate.swift

    Initializes BTKeyboard then uses CGEventTap to get keyboard events and send them to the connected Bluetooth device.

  • SerialPortDictionary.plist

    A service record with a Human Interface Device Profile (HID). The HID profile describes a keyboard and the report used is outlined in HIDReportDescriptor.txt

  • HIDReportDescriptor.txt

    The parsed HIDReportDescriptor outlines how the bytes are described for a generic keyboard.

bluetooth-keyboard-emulator's People

Contributors

arthuryidi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

bluetooth-keyboard-emulator's Issues

Help needed to make it work the other way around!

While trying to understand the code i realised that it is a mac app. How could i make the app the other way around, i a way that i cant type on my iphone and my mac would process the passsed data and "type". As if my iphone is a bluetooth keyboard.

It is a school project

Many thanks with helping me moving forward.

Can't seem to get this to work

Converted to Swift 3, tried to fix errors.. but now its says: Keyboard Connect Open Source[11548:1105748] [establishKernelConnection] Received an error from IOServiceOpen() - 0xe00002c7. NULLing out io_service_t.

Any help will be appreciated. Thanks

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.