Giter Site home page Giter Site logo

cryham / ckeys Goto Github PK

View Code? Open in Web Editor NEW
12.0 2.0 2.0 805 KB

Crystal Keys. Program showing pressed keys and keyboard layouts. Uses SFML and ImGui. Reads custom keyboard layouts, from JSON (basic) and parses KLL files.

Home Page: https://cryham.tuxfamily.org/portfolio/crystal-keys

License: GNU General Public License v3.0

CMake 1.90% C++ 81.59% C 16.51%
keyboard json jsmn cpp cplusplus sfml imgui tinyxml2 cpp11 kll

ckeys's Introduction

Crystal Keys (cKeys)

Program showing pressed keys and keyboard layouts.
Currently works on Windows, for GNU/Linux it should be easy to port.
Made as a support and visualization program for my keyboards CK3 and CK4 (more about them on my website).
More about the program below and here.

General

Used SFML for drawing all keys. Also for writting text in pressed list and (mouse over) key info.
Keyboard is real-time scalable with slider. Fit button resizes window to match it. Reset restores default scale 1.00.
For GUI elements used ImGui through ImGui-SFML (both are included in sources).
Windows Keyboard Hook is used to get key states (Virtual Key codes).

Tutorials

Earlier versions in releases: 0.1, 0.3 and 0.5
were just demo programs for using SFML, ImGui and TinyXML-2.
And can serve as tutorials or starting projects for similar applications, for both GNU/Linux and Windows.

Layouts

Program reads custom keyboard layouts, from JSON files (using jsmn parser library).
Which can be created, edited and saved from this web based editor: www.keyboard-layout-editor.com
The default.json layout is the ANSI 104 preset.

All *.json files located in data directory will be available in Layout combobox.
Program supports only basic rectangular layouts, no rotation or styling.
Additionally, I added own commands to json, which replace key names "n:Name" and assign scan code "s:12".

Layers

Since version 1.0 it also reads KLL files (specification, repo).
Basic parsing is done to get layer key bindings (mapping).

For e.g. ck3 keyboard the base map is defaultMapCK3.kll.
All ck3layer*.kll files in data dir are read for layers. Maximum number is 8.

Compiling

Using CMake, it should be possible to build easily.
I'm using Qt Creator IDE, which supports it.

On GNU/Linux you'll need to get SFML installed. At least version 2.2.
E.g. for Ubuntu (and Debian-based):
sudo apt-get install libsfml-dev

On Windows SFML needs the environment variable SFML_ROOT to be defined.
After this the program should build.

In sources there already are: TinyXML2, jsmn, ImGui with ImGui-SFML and Native File Dialog.

Screenshot with default layout

Screenshot with layers

ckeys's People

Contributors

cryham avatar

Stargazers

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

Watchers

 avatar  avatar

Forkers

swenzhai huguang6

ckeys's Issues

Settings: Missing symbol 'getC'

Hello, I'm porting cKeys to Rigs of Rods (RigsOfRods/rigs-of-rods#2477) and it appears the Settings::getC function as well as static vars in Settings are not defined, so the app shouldn't even build.

I didn't try to build ckeys alone though, I discovered this during my work. Sorry if I missed something.

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.