Author Topic: Apps to overlay keyboard function layers/programmatically set RGB LEDs  (Read 5480 times)

0 Members and 1 Guest are viewing this topic.

Offline Blazestorm

  • Thread Starter
  • Posts: 190
[App for displaying function layers]
I had an idea for an app this morning that would display your FN layers overlaid on your screen when you held the FN key (for learning new layouts/layers). I figured that most keyboards don't actually send any messages for the FN key and just handle it internally in their firmware. So might need another key-combo to "preview" the layout/layers. ctrl+shift+something (remappable).

What inspired this: I bought a Magicforce 68 (to try out small ~60% layouts) and plan to buy some other non-standard layout keyboards, HHKB, ErgoDox, etc. I already swapped the keycaps on the Magicforce, so now I have to go look online and find some images of the stock keys to remind myself what the FN layer is. I also swapped the keycaps on my Realforce RGB so I lost my FN layer there. You would have to do a little "setup" phase where you teach the app what keyboard you want it enabled for, and what layout it is actually capable of.

[App for controlling RGB lights]
Was also working on an app to handle RGB lighting of a variety of keyboards. This would be so much easier if all the companies agree on a standard for this (New HID standard maybe). In the mean time, I've been investigating what commands apps are sending to their keyboards (Starting with Realforce RGB). Started w/ a USB packet sniffer, but that was a little tedious. I did learn that Realforce sends the RGB values of their entire layout when you change the color of a single key, not very efficient... Now I'm planning on writing a USB/HID filter driver and an associated app to allow you to train/learn all the possible commands your app sends and then we can do it from a single place. Planning on HID unless someone knows a keyboard that sends non-HID commands, which I don't expect. I'm not a firmware guy though, other people should have more knowledge.

This would let you use your keyboard lights similar to an Android phone's notification light. i.e. you get a new email and your keyboard could pulse green once or twice. First version would be for Windows (most likely just Windows 10). You could also have an app that could hook into Spotify or any audio coming from your computer and sync the lights to the music. Just a few ideas of what it could be used for. I'm just tired of all these keyboard companies writing their own mediocre apps. Let them focus on the hardware and let software people do the software. Stop reinventing the wheel! =)

Does anyone know if either of these exist or anyone else think it might be useful?

Offline bmmcwhirt

  • Posts: 207
  • Location: Indiana
    • KB9YEN
Re: Apps to overlay keyboard function layers/programmatically set RGB LEDs
« Reply #1 on: Fri, 24 February 2017, 22:14:43 »
It's an interesting idea but there are some issues you have to overcome.

First many fully programable keyboards have limited space to store layouts now your wanting to add to that led layouts. There are ways this can be minimized but they would need evaluated.

You still have to remember what the color combinations are and mind map those to keys which I'm not sure(that would take experimenting) that would be any more efficient than memorizing the layouts. I'm not trying to discourage you just trying to point out some possible hurdles in your way before you get running.

This could actually be done with single color LED as well. the LED would just blink the morse code for the key when the preview key is held.


I would say start by writing down you goal and try to think of as many paths to get to that as possible then find the least complicated path.

I'll be following this to see what progress you make so do keep us updated.

Offline Blazestorm

  • Thread Starter
  • Posts: 190
Re: Apps to overlay keyboard function layers/programmatically set RGB LEDs
« Reply #2 on: Fri, 24 February 2017, 23:35:01 »
I think you might be confused, these are two separate apps/goals.

First app/goal would display an overlay of your keyboard layout, with the function layer you want to preview. Quick mock-up of what might happen when you press the preview button (picture borrowed from Elite Keyboards). This is actually pretty simple to implement, and is mainly there as a quick-assist tool until you learn your new layout. I'm not really concerned about the implementation of this one. The most tedious part will be how to generate all the different layouts you could have (programmatically, I ain't no artist).



Second app/goal would simply be setting up an standardized interface for setting the LED colors, so that you could control the colors of your RGB LEDs through your own code instead of downloading/installing individual apps from each manufacturer of every RGB keyboard you own.

Might lead to a new HID usage standard for vendors to implement: http://www.usb.org/developers/hidpage#HID_Usage

Until that's done, I can write a filter driver (for prototyping) for each of the known firmwares which would convert the new HID standard into their proprietary commands. Then when those companies do implement the standard, the apps would continue to "just work" without any modification. Then the only thing you would need to install is the filter driver and anyone could write apps against the new standard while hardware vendors catch up. I don't intend to handle macros or anything else proprietary, so they could still have their own apps for that. I just don't think the lighting needs to be done by them. Imagine if you had to install software for every keyboard you bought just to press the keys, that would be ridiculous. Why should we have to install their software just to use the lighting?

So there would be the first filter driver to "spy" on the commands that the apps send to their keyboards so we can reverse engineer their firmware. (Or I could ask nicely? :D) Then a second filter driver to implement the new HID usages and convert it to their proprietary commands. That would also allow you to continue use of old hardware that can't be easily updated.

There are some HID standards (pg 63) around setting LEDs already, but they're limited to a.) on/off (1 bit) and b.) only a few special lock keys: Caps, Scroll, Num, etc. That's how the OS can toggle your CapsLock LED even when you didn't press the key on that particular keyboard, i.e. you press CapsLock on keyboard A and keyboard B CapsLock LED also lights up. So this could end up as an extension of that, although it seems to be limited to single bits, not a range of values like RGB.

Offline bmmcwhirt

  • Posts: 207
  • Location: Indiana
    • KB9YEN
Re: Apps to overlay keyboard function layers/programmatically set RGB LEDs
« Reply #3 on: Sun, 26 February 2017, 23:34:15 »
One problem your going to run into is not all keys will send scancodes. Especially macro keys and Fn and a few others.

Offline Blazestorm

  • Thread Starter
  • Posts: 190
Re: Apps to overlay keyboard function layers/programmatically set RGB LEDs
« Reply #4 on: Mon, 27 February 2017, 02:40:28 »
One problem your going to run into is not all keys will send scancodes. Especially macro keys and Fn and a few others.

That will be an issue for trying to change lighting in response to key presses... i.e. if you press a "Fn" key and want the "Fn" key to light up, my program probably wouldn't be able to handle that.

In other news, I have the first hacked together Win32 LED app working w/ my Realforce RGB: http://giphy.com/gifs/NI342tA0iXQ9W

I just set it up to set all the keys to random colors when you press 'U'. Looks terrible, but proves I can send HID commands to the Realforce and it responds.

Offline dantan

  • Posts: 288
Re: Apps to overlay keyboard function layers/programmatically set RGB LEDs
« Reply #5 on: Sat, 08 April 2017, 11:32:25 »
I do wonder, with their geniuses at figuring out keyboards, you'd think that RGB LED technology and controlling LEDs have become common on geekhack by now.

Offline ErgoMacros

  • Posts: 313
  • Location: SF Bay Area
Re: Apps to overlay keyboard function layers/programmatically set RGB LEDs
« Reply #6 on: Sat, 08 April 2017, 16:40:14 »
A few thoughts...
1. I applaud your universal keyboard goals for this. If, however, the keyboard is programable enough you may be able to do something like this:
  • Detect Fn or Layer key press
  • Switch layers...
  • ... and send a special key to the OS. Perhaps F13-F24, many keyboards don't send these
  • The OS can then display an overlay (For OS X I'd use Hammerspoon for this)
  • When the Fn key is released send F13 again and have the OS drop the overlay.
Still a lot of "manual" set-up, for example generating images for the different layers

2. If the goal is to learn the layout, rather than create amazing software  ;) , I've turned my keyboard legend into a desktop background. Works better if you can live w/o some screen real estate for a while. 
165180-0

Cool projects though. Wishing you the best success.
Today's quote: '...“but then the customer successfully broke that.”

Offline unai.ndz

  • Posts: 1
Re: Apps to overlay keyboard function layers/programmatically set RGB LEDs
« Reply #7 on: Thu, 27 April 2017, 14:25:47 »
I love both ideas.

I am trying to change some of my fancy keyboard light layouts for something customized and useful, or maybe just add other layouts. (My keyboard only have one customizable layout)

It will be awesome if you make the program but I think it will take a while.

Can you share which sniffer are using? I apreciate it so much. I don't think i can help but i wish to mess with that anyways and try something. If I get something I will post the info and my keyboard. Maybe it helps.

PD: I search for a USBsniffer but I can't get any of them to work.