Skip to content
/ ketill Public

๐ŸŽฎ An API for dynamic device I/O.

License

Notifications You must be signed in to change notification settings

whirvis/ketill

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

ASCII art displaying KETILL

Contributor Covenant 2.1 MIT License Java 8 Code Quality Jenkins

๐Ÿ”– Summary

Ketill provides dynamic device I/O for Java. Created from code originally written for the Ardenus Engine, it is intended for use in game development. However, other use cases are supported. Ketill paves an avenue to supply universal definitions for I/O devices (such as keyboards, mice, XBOX controllers, etc.) while keeping implementation details separate.

๐Ÿ““ History

Development on Ketill began in the fall of 2021. While working on a revision of the Ardenus Engine, I decided that I wanted to create a new input system from the ground up, since the original was clunky. At the time, Ketill was simply the input package of the engine. Later, as the package grew in size, I realized it could work as its own library. This would allow seamless integration with other projects.

After much refactoring, the input package was moved to a separate repository and was reborn as a Maven project (like its ancestor). Following additional weeks of coding, the decision was made to split the now monolothic library into modules. While Maven supports modules, they are a nuisance to work with. However, while tinkering with FabricMC one night, I was introduced to Gradle. The cleanliness of its build scripts was delightful, so the decision was made to use it for future projects.

๐Ÿ‘พ Why use Ketill?

By design, the definition of an IoDevice is kept separate from the code which implements it. The implementation of a device is provided by an IoDeviceAdapter. Keeping the definition and implementation separate provides the following primary benefits:

  1. The code for defining a device is (usually) small.
  2. Said definitions rarely require logic, just a statement of features.
  3. Device definitions requires little or no unit testing when properly written.
  4. The same device can be implemented with different adapters, enabling features as desired.
  5. Cross-platform support (e.g., using GlfwXboxAdapter on MacOS and XInputXboxAdapter on Windows).

Ketill also provides a litany of built-in definitions and implementations. The goal of these built-in devices and adapters is to reduce the time required to get device I/O up and running. They also serve as examples for those who wish to create their own devices and/or adapters.

The following is a list of modules included with Ketill:

Module Description
api The base API for Ketill.
device Provided definitions (Keyboard, Mouse, XboxController, etc.)
adapter Provided implementations using GLFW, X-input, etc.

๐Ÿ› ๏ธ Building

If you don't want to build Ketill yourself, pre-built JARs can be found on Jenkins. However, in certain situations, building the project yourself may be necessary (e.g., if Jenkins is down.) Building Ketill is simple, and can be done following the instructions below:

  1. Install Git if not done so already.
  2. Install the JDK. Builds of the OpenJDK can be found here.
  3. Open a terminal of your choice and run the following commands:
git clone https://github.com/whirvis/ketill.git
cd ketill
chmod +x ./gradlew # unix only
./gradlew build

# install to local Maven repository if desired
./gradlew publishToMavenLocal

๐Ÿ–ฅ๏ธ Technologies

Category Technologies
Development Eclipse Adoptium, IntelliJ IDEA, and Java 8
Build System Gradle and Jenkins
Unit Testing Equals Verifier, JetBrains Annotations, JUnit 5, and Mockito
Quality Assurance Codacy and Sonatype Lift
Adapters GLFW 3 (via LWJGL 3), JXInput, Usb4Java, and Hid4Java
Libraries GSON and JOML

๐Ÿ’Ž Special Thanks

  • My friend Surhou, for creating the project logo (which is still in progress, the one above is a placeholder).
  • My Uncle, for introducing me to Mockito when I was seeking advice for writing unit tests.
  • My colleagues at university, for cheering me on through the two semesters that I wrote this.

Twitter Reddit YouTube Twitch Discord