Animation

From kll.wiki
Jump to: navigation, search

Animations allow you to program the LEDs on your Keyboard. KLL gives you a lot of flexibility in designing your animations, letting you either specify specific colors for individual LEDs or having the configurator paint parts portions of your board for you.

Handy animation-related links:

Animations are coded in frames that look like this:

P[96](255,0,0),P[97](255,0,0),P[98](255,0,0),P[99](255,0,0),P[100](255,0,0),P[101](255,0,0),P[102](255,0,0),P[103](255,0,0),P[104](255,0,0),P[105](255,0,0),P[106](255,0,0),P[107](255,0,0),P[108](255,0,0),P[109](255,0,0),P[110](255,0,0),P[111](255,0,0),P[112](255,0,0),P[113](255,0,0),P[114](255,0,0),P[115](255,0,0),P[116](255,0,0),P[117](255,0,0),P[118](255,0,0),P[119](255,0,0),P[88](255,0,0),P[89](255,0,0),P[90](255,0,0),P[91](255,0,0),P[92](255,0,0),P[93](255,0,0),P[94](255,0,0),P[95](255,0,0);
P[96](255,255,255),P[97](255,255,255),P[98](255,255,255),P[99](255,255,255),P[100](255,255,255),P[101](255,255,255),P[102](255,255,255),P[103](255,255,255),P[104](255,255,255),P[105](255,255,255),P[106](255,255,255),P[107](255,255,255),P[108](255,255,255),P[109](255,255,255),P[110](255,255,255),P[111](255,255,255),P[112](255,255,255),P[113](255,255,255),P[114](255,255,255),P[115](255,255,255),P[116](255,255,255),P[117](255,255,255),P[118](255,255,255),P[119](255,255,255),P[88](255,255,255),P[89](255,255,255),P[90](255,255,255),P[91](255,255,255),P[92](255,255,255),P[93](255,255,255),P[94](255,255,255),P[95](255,255,255);

This is an animation for flashing the underglow lights on a K-Type. Look below for a breakdown of how it works.

Pixels

To turn on a single LED on your keyboard, specify it as a pixel, like so:

P[1](255,255,255)
K-Type LED Map

In this example, 1 corresponds to the ID number of the LED to be turned on. The 255,255,255 specifies the RGB color value for that pixel (in this case white). These values go from 0-255. Take a look at Common RGB Colors for some examples of how to make common colors (Color pickers are also very helpful).

To specify more than one pixel, simply put them one after another with a comma linking them:

P[1](255,0,0),P[2](0,255,0),P[3](0,0,255)

Frames

This is all well and good, but we don't want to just light up our LEDs, we want to animate them! To do that, we need to specify multiple frames, that will play one after another. When you've finished specifying your first frame, end that string of pixels with a semicolon like so:

P[96](255,0,0),P[97](255,0,0),P[98](255,0,0),P[99](255,0,0),P[100](255,0,0),P[101](255,0,0),P[102](255,0,0),P[103](255,0,0),P[104](255,0,0),P[105](255,0,0),P[106](255,0,0),P[107](255,0,0),P[108](255,0,0),P[109](255,0,0),P[110](255,0,0),P[111](255,0,0),P[112](255,0,0),P[113](255,0,0),P[114](255,0,0),P[115](255,0,0),P[116](255,0,0),P[117](255,0,0),P[118](255,0,0),P[119](255,0,0),P[88](255,0,0),P[89](255,0,0),P[90](255,0,0),P[91](255,0,0),P[92](255,0,0),P[93](255,0,0),P[94](255,0,0),P[95](255,0,0);

(Note that the configurator will automatically remove the last semicolon from your animation when you flash it. This is fine)

Then, start a new frame like you did before. Look at the very first example to see multiple frames put together. Once you have all the frames you want specified, you can copy your code into the animation box of the configurator.

Advanced Pixel Definition

KLL can help you create some kinds of animations yourself so you don't have to manually define each pixel for each of your frames. Here are some options:

Rows and Columns

To paint an entire row or column of your keyboard a single color, you can use the following format:

P[c:50%](0,0,255)

In this case, the [c:50%] says that half of your keyboard, from the left, will be painted the color specified (in this case solid blue).

P[r:50%](0,0,255)

This example would paint half of your keyboard blue from the top down instead. You can combine the two into a coodinate address like this:

P[r:50%,c:50%](255,255,255)

This will light up the single pixel (key) that is in the middle of your keyboard. You can also use absolute numbers instead of percents for rows and columns by simply removing the percent symbol in the examples above. Note that columns are a little odd when using a staggered keyboard like the K-Type and Whitefox. Also be sure not to go over the maximum number of rows or columns on your keyboard, as that can lead to inconsistent results.