GithubHelp home page GithubHelp logo

astromonkee / x1kit Goto Github PK

View Code? Open in Web Editor NEW

This project forked from fizzyade/x1kit

0.0 0.0 0.0 41 KB

A swift package for adding support for the Citrix X1 mouse to iOS applications.

License: MIT License

Swift 100.00%

x1kit's Introduction

Logo

Language: Swift 5 License: MIT

X1Kit

X1Kit is a Swift framework that allows applications to make direct use of the Citrix X1 mouse.

Purpose

The X1 provides a Bluetooth Low Energy (BLE) protocol to report position and buttn states, it is capable of operating as a standard BLE mouse or additionally a mode which allows iOS applications to directly access the mouse without any operating system support, this library allows applications to take advantage of this feature.

Requirements

  • A Citrix X1 mouse, the mouse should be paired with iOS.

Usage

Import X1Kit at the top of the Swift file.

import X1Kit

To use CoreBluetooth you will need to add the following keys (with a value explaining the use of bluetooth) to your application Info.plist, failure to add the appropriate key will result in your application crashing.

iOS 13 or later:

NSBluetoothAlwaysUsageDescription

iOS 12 or earlier:

NSBluetoothPeripheralUsageDescription

The application should instantiate an instance of the X1Mouse class and set the objects delegate to an object that implements the X1KitMouseDelegate protocol.

let theMouse = X1Mouse()

theMouse.delegate = self

The following protocol is defined by X1Kit and should be implemented.

protocol X1KitMouseDelegate: class {
    func connectedStateDidChange(identifier: UUID, isConnected: Bool)
    func mouseDidMove(identifier: UUID, deltaX: Int16, deltaY: Int16)
    func mouseDown(identifier: UUID, button: X1MouseButton)
    func mouseUp(identifier: UUID, button: X1MouseButton)
    func wheelDidScroll(identifier: UUID, deltaZ: Int8)
}

License

This project is open source and is released under the MIT License

Distributed as-is; no warranty is given.

x1kit's People

Contributors

fizzyade avatar cgutman 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.