Java speedrun timer. Fork of the official version at http://jenmaarai.com/llanfair/
This repository has been archived on 2023-07-11. You can view files and clone it, but cannot push or open issues or pull requests.
Go to file
Gered 20bd866eba add toggle for global/non-global hotkeys. add hook registration retry
kind of a hacky implementation, but it works.

ideally i would like to not depend on JNativeHook at all if global
hotkeys are disabled and provide some sort of "dual" event processing
using both the built in Swing key press events and the native key press
events, using input from whichever is appropriate based on the user
settings.

however, JNativeHook and Swing use different key codes. it would be
possible to write some code to translate between the two, but i don't
have a bunch of different keyboards and OS installs to test this
properly and feel that the odds of me writing some key code translation
function that doesn't work 100% of the time is a bit too high.

so, we just use JNativeHook for global and non-global and test for
window focus depending on which is enabled. this has the unfortunate
consequence of requiring that the key event hook registration was
successful regardless of if the user wants to use global or non-global
hotkeys. kind of annoying, but can't be helped for now!
2015-12-02 12:52:49 -05:00
src/main add toggle for global/non-global hotkeys. add hook registration retry 2015-12-02 12:52:49 -05:00
.gitignore use gradle for building, reorg src/res dirs, add Sidekick lib source 2015-11-29 23:46:50 -05:00
build.gradle update version for development of next release 2015-11-30 15:23:38 -05:00
README.md update README.md 2015-11-30 15:06:38 -05:00

Llanfair

From the homepage:

Llanfair is a free software that helps speedrunners keep track of their run. Released in August 2012, its capacity for customization and its portability allowed it to garner some recognition in the scene. Developed in Java, Llanfair can run on Windows, MacOS, or Unix.

The original author Xavier "Xunkar" Sencert was kind enough to release the sources (see here and here) when I asked. I'm not completely certain if Xunkar ever intends to continue development of Llanfair himself as it seems he uses LiveSplit now (?).

Regardless, here I will be extending the original application as best I can by adding some missing features here and there and fixing bugs as needed.

Building and Running

You will need Gradle. The Gradle application plugin is being used, so you can run Llanfair simply by doing:

$ gradle run

To package up a JAR file for redistribution, run:

$ gradle shadowJar

Which will spit out an "uber JAR" under build/libs under the naming convention llanfair-[VERSION]-all.jar.

Mac OS X and Accessibility Settings for Global Hotkeys

Previous releases of Llanfair used an older version of JNativeHook which didn't really provide any built-in help if OS X was not properly configured in advance when Llanfair tried to hook into global key events. This version uses a more recent version that pops up a dialog telling you what to do if Llanfair does not yet have the required accessibility permissions, so you should not get the problem where Llanfair mysteriously closes immediately after running.

Note that currently Llanfair only supports hotkeys via the JNativeHook / global hotkey interface! If it was not able to hook into the OS's key events (either because you denied proper permissions or for some other reason), then you will not be able to set any hotkeys in the settings window and you will thusly not be able to trigger any splits or start/stop any runs! This is one of the first things I intend to address.

TODO

Lots of stuff still to be done. :)