#🤖│community_dev

1 messages · Page 20 of 1

quiet root
bright narwhal
#

dont @ me on "how the system works", you literally suggested RGB might be stored as a string on an MCU or "icecream cones" for all you know

quiet root
#

if wooting gets up there to streaming media

#

i will ask for a change

#

yes

#

tmw someone doesnt get sarcasm

#

yes i storngly believe usb to be able to carry ice cream cones

#

and my pc to be able to produce them

#

i mean

#

why wouldnt it

#

tmw roblox requires more traffic than wooting

knotty night
#

@grizzled wolf I just tried WootingAHK on FW 1.25.5 and it was fine

#

Have a guest tonight, so cannot really do much on it

grizzled wolf
#

@knotty night I'm on 1.25.6, is there an easy way to rollback to 1.25.5

knotty night
#

Dunno, I more suspect the W1

knotty night
#

Anyone out there with a W1 and a W2, and on Windows, and who uses AHK? Need Wooting AHK tested with the W1 to see if it works https://github.com/evilC/WootingAHK

#

W2 obv should be good, but tompas here seems to be having problems getting it working on W1

grizzled wolf
#

indeed 😃

fathom garnet
#

Can test once I’m back home in a bit

knotty night
#

ta

glacial horizon
#

ta

knotty night
#

It could also potentially be an ANSI issue I guess. I have an ISO W2, so have only tested with that

fathom garnet
#

W1 ansi, the allkeytest script closes after I press go

wet knot
#

ta

fathom garnet
#

the example or simple example seem to start and then exit instantly

jaunty thistleBOT
#

Alright, @fathom garnet has been warned for 'Bad word usage'.

fathom garnet
#

@wet knot your bot deleted my message roo4

wet knot
#

you said a bad word

fathom garnet
#

box? uncheck?

wet knot
#
Reason
Bad word usage
Channel
#woot_dev
Message
Calder is lame
fathom garnet
#

???? thats not even remotely close tt what I wrote

wet knot
#

i know the truth 👀

#

Anyway i fixed it

#

Sorry

#

for some reason "box" was added

#
if I uncheck the block keys box it doesnt close itself
``` -Quintosh
fathom garnet
#

well, the deleted message was wrong anyway, it now closes itself even if I uncheck the box lul

#

updated firmware, same issues, I see the AHK symbol in my taskbar in the bottom right when I start simple example or example, but when I hover over them they are gone

#

so might be a W1 issue

knotty night
#

Thanks @fathom garnet , it looks like the problem is as I suspected and with the Analog SDK DLL

knotty night
#

<@&490097707487330305> are we aware of any issues with the analog API on the W1, specifically high latency in responses?

#

Have only tested with the .NET SDK

#

I am not getting anything on my W2, but @grizzled wolf is getting a large delay, in the region of ~500ms apparently

#

I have some sample code that just targets the .NET SDK that repros for him but not me

fathom garnet
#

need me to try something from this again to double check?

chilly oar
#

I can't help you at the moment, my keyboard is still apart.

boreal nest
#

From previously running into it with Node on the W2, the delay seems to be from not reading the interface quick enough. I don't know for sure but I'd guess it's buffered and not reading it faster than it fills means you get a delay of however large the buffer is

#

Whether it's hidapi that buffers or OS-level drivers, I dunno. I didn't dig that far into it

knotty night
#

I read it on a 10ms loop, and am not generating data that fast. Besides, @grizzled wolf was tapping a key, releasing, waiting, then tapping again and it would be delayed - I don't think the buffer had anything in it

#

It seems to either be W1 specific or maybe something environmental

#

@fathom garnet If you could verify whether things are delayed for you, that would be great

chilly oar
#

It doesn't matter if you press a key or not, the RAW interface will continuously send data over USB.

knotty night
#

ah good point

#

It behaves differently for both of us tho, so I don't think it is an inherent issue affecting everybody

#

It works fine on my machine ™

chilly oar
#

What I was indicate with this is that it's possible that the buffer are full and because of this you can have the delay.

boreal nest
#

Are you beginning the reading immediately after opening the connection?

knotty night
#

The code is above

boreal nest
#

As for a 10ms loop... try between 6 and 8 if you can

knotty night
#

Min granularity of sleep is ~10-15ms

boreal nest
#

Ahh

knotty night
#

not easy to do ms accuracy timers in C#

#

in fact from what I understand, it's a bit of a bugger on windows, period

#

without chewing excessive CPU that is

#

I think I can maybe improve it tho - use a blockingcollection or something

#

by pulling the polls off into a blockingcollection, I could remove the sleep

#

that's what I do in WootingAHK

boreal nest
#

From my testing... these are the read times I'm seeing (in ms)

8
12
12
12
16
8
8
16
8
12
16
8

(granted this is NodeJS, so the multiples-of-4ms could be Node event loop artifacting)

knotty night
#

But for this sample code, I wanted to keep it simple

boreal nest
#

So 10-15ms might be just a tad too slow

knotty night
#

It does not have to be super-efficient, as long as it exhibits the difference in behaviour

#

cos @grizzled wolf was seeing delays in the order of hundreds of ms

#

like 500

boreal nest
#

Yeah, because if you're only reading out 3 of every 4 inputs into the internal buffer (I'm guessing there's one), then that means 25% of the reads USB does begin filling the buffer

knotty night
#

but the problem is that the first input is delayed

boreal nest
#

From those above samples (12 samples, total of 136ms), if you're only reading every 10-15ms, means in that amount of time you read between 9 and 13 samples

knotty night
#

like 500ms between console.readkey seeing the key change state, and the first analog update coming through

#

so the buffer will be empty at that point surely?

boreal nest
#

As soon as the connection is opened, the buffer begins to fill

#

The keyboard is always spraying analog data over USB

knotty night
#

but there is code pulling stuff out the buffer constantly

#

so if you let it start, the buffer should be essentially empty?

#

I suppose it depends on how the .NET wrapper works

boreal nest
#

Any delay between the creation of the HID interface (hidopen() or whatever) and you beginning to read is data into the buffer

#

So if you don't start reading until there's user interaction, that's going to immediately fill the buffer

knotty night
#

no, it reads constantly

boreal nest
#

That's why I had asked if there's any delay between open and reading. Your posted code only had the reading step

knotty night
#
while (true)
{
    var val = AnalogReader.ReadAnalog(1, 1) // <-- pull from buffer
...
boreal nest
#

Yep. That's reading. But is AnalogReader initialized right before that loop?

knotty night
#

it's static

#

but essentially, yeah

#

the analogreader is just a p/invoke

#
        [DllImport(sdkDLL, EntryPoint = "wooting_read_analog", CallingConvention = CallingConvention.Cdecl)]
        public static extern byte ReadAnalog(byte row, byte column);
#

so the dll loads, then it starts polling straight away

boreal nest
#

Depends on how the binding sets up the connection

#

It should be pretty quick.. hmm

knotty night
#

But as I said, it's not an inherent problem

#

works fine on my W2

#

no delay

#

so it seems to be some kind of compatibility or environmental issue

boreal nest
#

That's .. o_o Huh..

knotty night
#

so just trying to work out what the conditions are to repro

#

Suspect it is W1, but cannot be sure...

boreal nest
#

Curious.. wasn't there some weirdness if you plugged a W1/W2 into a USB3 port?

#

I know that's one of the recommended things to check if there's fw update issues

knotty night
#

I dunno what he was plugged into

grizzled wolf
#

i do have it plugged into usb 3.0 as I have no usb 2.0 ports on my laptop

quiet root
#

wha

#

most laptops usually have at least 1 usb 2 port

wet knot
#

Nope

#

A lot these days are all usb 3

#

And usb c

grizzled wolf
#

i reset the keyboard firmware on a different cpu with usb 2.0 and still have the same problem anyway

#

so i don't think the problem is usb 2.0 specific

quiet root
#

so far all laptops i sell and have sold still had at least 1 usb2

#

all business shit tho

wide nymph
#

@knotty night @boreal nest I see you guys are figuring out a puzzle. @hybrid lake might be able@to give some info on this.

pearl tartan
#

Do I need any header files to use the DLLs?

pearl tartan
#

Do I need any header files to use the DLLs?

wet knot
#

@pearl tartan sorry there's no answer for you, I don't really know much

pearl tartan
#

Ok. Thanks anyway.

fathom garnet
#

well the question is a bit vague, what dlls do you want to use?

pearl tartan
#

For example, if I wanted to use the analogue DLL in my C++ project, do I need any header files?

#

@fathom garnet

fathom garnet
#

not really worked with dlls in c++, but I think you just declare the class and functions in a .h and that should be it?

#

pretty sure one of the community projects on the dev site is in c++, could check there how its done

pearl tartan
#

Thank you, I will take a look.

pearl tartan
#

Do I need to source code, for the header files, to use the DLL in my C++ project?

#

For example the Analogue SDK Source.

fathom garnet
#

? no the point of dlls is to not work with the source code directly

pearl tartan
#

How do i add them to my project?

calm dock
#

Is there any way of controlling the depth of a key press for DKS? The four options are not granular enough. I've also noticed the keyboard is inconsistent with the key presses. For example I have mapped the W key to press W, when the key is fully depressed I want SHIFT W to be the key combination, and then W to be the only key pressed when I release the key from the fully depressed state. However I noticed that SHIFT stays on despite the key being released almost to it's full un-pressed state. This is inconsistent and feels like a bad polling issue? Ideally I would like to have it so that when I press a key beyond say 80% the shift key is pressed as well as the W key. One I reduce pressure to release the key under 80% the shift key is released but the W key remains pressed until the key is fully released altogether. I hope that makes sense! Thanks in advance for any assistance / advice!

hybrid lake
#

@pearl tartan not necessary, you can just define the functions when you load the library in whatever language you use

#

This is how it can work with js

wide nymph
#

@calm dock make sure that shift is a line up to the 3rd icon. The 4th icon represent the release of the key, when it stop right before the 4th icon l, it will still stay on until key is entirely released.

#

Something we might need to improve in UX?

calm dock
#

@wide nymph Thanks for the tip. Any possibility of having a variable to set the percentage or analogue input value for the additional keys to activate / deactivate? The UX and UI could be improved somewhat - but progress has been made and is greatly appreciated! Keep up the great work.

wide nymph
#

We had considered it but in practicality you’d have a hard time to control it. We felt this was easier to understand and control.

pearl tartan
#

@hybrid lake Thanks. You mean in just in a header file?

calm dock
#

Okay, fair enough. Nice to have had direct communication with you. congrats again on an awesome keyboard @mint merlin!

pearl tartan
#

@wide nymph Thanks. You mean in just in a header file?

pearl tartan
#

Do I need a .lib file, for example, the analogue.dll , to link against at compile time?

#

I still do not understand how to use just a dll file, in a VC++ project?

#

Would I need to use the Win32 API?

quiet root
#

use imports

#

and import functions from the dll

fleet saffron
#

Or you can create the lib file from the dll as mentioned in the second answer to that stackoverflow question

#

But it'd probably be easier to compile the SDK yourself and then use that

quiet root
#

wha

pearl tartan
#

@fleet saffron Thank you very much.

quiet root
swift raven
#

Hey! So I got my wooting one yesterday and so far I am loving it. One thing I do miss from my last keyboard though is the ability to switch the Esc and Caps Locks keys. I know it sounds weird but as a VIM user this is just easier imo. Would there be a possibility to implement such a feature?

glacial horizon
#

Sounds like an AHK thing, maybe the ahk god @knotty night is able to help you out.

#

Maybe even a simple macro program which is able to rebind keys is able to do that, though

#

There currently is no way of rebinding digital keys in the wootility, so third-party software will be needed

swift raven
#

Ok I will try out AHK. Thanks for the tip @glacial horizon

glacial horizon
#

Hmu if you need further assistance, not very good with ahk though :P

#

Also, when playing games, make sure to turn it off. iirc it can trigger some anti-cheat services

swift raven
#

Okay I will note that

storm bluff
#

The First thing when I got wooting one, I disable all the RGB. The SECOND thing is to use a USB convertor to remap to Colemak layout.

#

Full key programmability is really needed for this GREAT keyboard.

quiet root
#

its comming

#

one day

storm bluff
#

the USB convertor use tmk from hasu, it works well for me now!

quiet root
#

but doesnt it ruin the analog

storm bluff
#

yes, analog is not what I want.

#

I just want a smooth keystroke.

#

and of course, without the convertor, I still have the analog.

#

I may add the Xinput function to the convertor, so that it can also support the analog. I will look into the source code when I have time.

#

Full key programmability is an essential feature for me.

quiet root
#

the kbd has xinput and dinput

fleet saffron
#

but, why do you need a USB converter to change the keyboard layout? I just changed my layout in the OS

quiet root
#

same

#

like i get why ud use a usb dongle for macro keyboards and use some special keys that no one ever needs

#

but remapping to a different layout is easy in most OS

#

there is colemak layouts downloadeable for windows

#

by the weird layout project guys

knotty night
#

@swift raven Normal AHK might not be that great for switching those particular keys, not sure how deep it would go (AHK only sends synthetic input). I do have another library though which uses a custom keyboard driver, so can mutate input below the OS layer. See https://github.com/evilC/AutoHotInterception

#

You would want "Subscription Mode", not "Context Mode"

glacial horizon
#

I tested it with a different macro program, not familiar with ahk, which is software input / output based and it seemed to work

fleet saffron
#

Do note that the interception driver will break keyboard input when you reconnect your keyboard until you restart your PC (I have a finicky hub that tends to reconnect when a speck of dust falls on it, so I found it very annoying but your mileage may vary)

glacial horizon
#

i dont think its needed in this case anyway, seems to work as expected for me

knotty night
#

@fleet saffron Whilst I have seen similar issues, with AHI if you reconnected your keyboard, you could restart the script and it would find the new ID. If you happened to have a lot of keyboards (ie close to 10 devices) then it would break until reboot, but that's quite rare

#

The main time most people see it is if using hibernate

fleet saffron
#

That's why I mentioned my hub. I wasn't even using it for my wooting, but for a cheap numpad I was using as a macro keyboard, and when the hub reconnected I wouldn't be able to use either anymore until I rebooted.

#

Having a unifying dongle in the hub probably also helped, because afaik that also creates a keyboard device

knotty night
#

Some keyboards create 4 devices (eg some corsair one with macros out the wazoo)

#

Partial failure happens when you reconnect and all devices get a new ID, but if the new IDs go over 10, then the device becomes unusable, as Interception only supports 10 of each

#

At some point I mean to have a look at it and see if I can get it to gracefully recover - eg maybe detecting plug / replug and reloading the DLL or something may do it?

fleet saffron
#

I don't think that would help, as the dev says it's done on the driver side of Interception and fixable by getting a source license for Interception

#

But if you get it to work I'd love it!

knotty night
#

It's gonna be a bugger to test I think as youwould need a lot of hibernating / rebooting

#

Will try and find the time to take a look this weekend

#

Oh and FYI forget buying the source, we tried

#

We are in the process of trying to reverse engineer it

gusty kayak
#

anyone know the phototransistors and leds used in the keyboards?

wide nymph
#

Is there anybody interested in making an app to use analog with Adobe?

#

😛

civic light
#

What MCU does the Wooting use?

chilly oar
civic light
#

I wonder why an ARM chip wasn't used.

#

Thanks.

quiet root
#

id guess an arm chip needs more passive components to function

#

could also be that a similar specced arm cpu has a higher price tag

#

and id guess no real benefits

#

sure the arm one would be 16bit

#

but i think the wooting doesnt do anything that would require 32bit integers

chilly oar
#

The Wooting is a device not a computer on its own. You don't have a PC into your mouse or headset or whatever just to send controls.

#

It's not like a TV who is a computer today...

quiet root
#

i think he means arm as in smt32 chips

#

smth like that

#

where the cores are arm based

#

which like i said costs more for the same storage cap etc and would only give u 32bits instead of 16bits arithmatic

chilly oar
#

Even these types are little CPUs.

quiet root
#

which is not useful for the kbd

#

so we rather save the 70cents per chip

#

and keep the cost down a bit

chilly oar
#

The purpose for the ATxmegas are small devices, so all you need is integrated. As far as I know for the ARM chips you need additional storage, memory and a few other things in order to work.
The ATxmegas can only do special hardcoded stuff (Harvard architecture) but on a ARM you can do enything (Von Neumann architecture).

civic light
#

I am talking about embedded ARM chips. They offer more power for the same price. The custom keyboard community has been moving towards ARM because it allows for more advanced firmware features.

civic light
#

Think tachyon mode with all the other features enabled.

#

Except maybe RGB animations which are useless and only slow down keyboards.

glacial horizon
#

That is the only thing that gets disabled though

civic light
#

I mean you could have both with ARM but I just don't see the point. ;d

glacial horizon
#

how do you mean both? ;)

civic light
#

RGB animations plus tachyon mode.

glacial horizon
#

Oh right, well imo its kinda distracting in games, but could be cool

#

dont see myself using that though

civic light
#

In any case, the MCU used is still decently powerful.

glacial horizon
#

Agreed, im okay with the way it functions now

quiet root
#

@civic light an equally specced arm is pricier

#

why would we go even more expensive just to get rgb and tachyon

gusty kayak
#

@civic light it uses the atxmega128a4u as mentioned, and a bunch of high speed analog multiplexers

#

this one in particular

#

CD74HC4067M

#

they use an rgb led driver for the rgb leds as well iirc

wide nymph
#

@civic light ARM is indeed great to move to in the future, we have considered it, but at the time we made the original decision, AVR was/is more accessible and easier for people to wrap their head around and sufficient for our requirements.

#

At that time

sleek grove
#

is it possible to individually control the brightness of each key via the rgb sdk?

#

e.g. if I want to smoothly pulse a colored light on a single key from 0% to 100% brightness

#

and if not, is it a hardware or api constraint?

#

looking at the api it looks like it should work if you just scale the rgb values you pass to wooting_rgb_direct_set_key but I just wanted to double check

chilly oar
#

As long as I remember it you need to adjust the colour values in order to set the brightness of the colours.

#

I don't think there is a parameter or function for this.

sleek grove
#

the more I think about it I think that makes sense

#

I just want to be able to make pretty interactive keyboard animations with lots of contrast between different colors

hybrid lake
#

@civic light A little late, but here are some of the reasons. This is about 4 years ago now. With the knowledge and experience I have now I would definitely go for an ARM chip.

  • The Xmega series has very fast ADC processing
  • ASF has a pretty decent USB stack with out of the box support for most situations
  • I used AVR before

We've noticed the trend in the keyboard community too and it makes sense. We are going to make the switch at some point in the future too. For now it's just not worth to deal with a rewrite, different versions etc and honestly the xmega has been holding up pretty well so far.

chilly oar
#

So the question will be, can the future product from Wooting with an ARM chip run Doom? 😉

sleek grove
#

using the key LEDs as the display

chilly oar
#

Of course 😊

sleek grove
#

running at 22?x6 resolution

chilly oar
#

It shouldn't have to be perfect...

sleek grove
#

actually, is it even possible to make interactive keyboard rgb animations?

#

e.g. when a key is pressed, the ones around it light up

#

I think node can listen for keyboard events globally even if there's no window to focus but just want to make sure

chilly oar
#

If you can code you can create what ever you want...

#

You know there are some built in RGB effects right? Some of them do the things you descibe...

sleek grove
#

yeah I work with node for web apps but I haven't done much desktop stuff with it

#

implementing interactive keyboard light toy programs is one of the reasons I bought a wooting lol

hybrid lake
#

Doom should be doable with PC side rendering 😄

sleek grove
#

for sure

quiet root
#

i mean someone made the chrome dino game for the twooting

#

u just have to deal with shitty res

boreal nest
#

@sleek grove You can use the analog portion of the SDK to listen to keys regardless of focus. As for individual key dimming, that's possible by applying an alpha blend to black with whatever the base color is. There's a slight got'cha in the array-based portion of the SDK in that you need to do a gamma correction on the input or it will show incorrect colors on the keyboard. Since you mentioned Node, I should link https://github.com/ApeironTsuka/wooting-sdk as it makes easier to do much of this (and I wrote it, so.. can't blame me for shamelessly plugging it XD)

#

As an example for pretty much everything above (not 100% guaranteed to work as-is, since I mostly typed this up on here, but it should barring any typos)

const { Keyboard } = require('wooting-sdk'), { Toolkit, lockLayer } = require('wooting-sdk/toolkit'), { Layer, Renderer } = require('wooting-sdk/layered');

// Begin boilerplate
let kb = Keyboard.get(), tk = new Toolkit(), renderer = new Renderer(kb);

kb.init();
kb.leds.mode = Keyboard.Modes.Array;
kb.leds.init();
kb.leds.autoUpd = true; // optional; without it you'd need to call kb.leds.updateKeyboard() every "frame"
tk.use(Toolkit.Features.AllLayered); // enables the locks layer, which is managed internally and handles managing the capslock/numlock/etc changes, enables the profile watcher, and a little clean exit helper
tk.enable();
tk.init(kb);
// End boilerplate, set up the layers
let locks = new lockLayer(tk), bgLayer = new Layer(), fadingLayer = new Layer(), alpha = 255;
// Set up the renderer
renderer.addLayer(bg); renderer.addLayer(fadingLayer); renderer.addLayer(locks);
bgLayer.setColormapNoAlpha(kb.leds.profile.map);
tk.on('profileChanged', () => bgLayer.setColormapNoAlpha(kb.leds.profile.map));
fadingLayer.fillColormap(255, 255, 255, alpha); // fill it white + opaque
renderer.init(); // updates at 10fps by default

let tmr = setInterval(() => { // watch the keyboard
  let { analog, actuationPoint: ap } = kb, { Up, Down } = Keyboard.Analog; // lazy
  if (analog.readKey(Up) > ap) { alpha += 10; if (alpha > 255) { alpha = 255; } fadingLayer.fillColormap(255, 255, 255, alpha); }
  else if (analog.readKey(Down) > ap) { alpha -= 10; if (alpha < 0) { alpha = 0; } fadingLayer.fillColormap(255, 255, 255, alpha); }
}, 100);
// some just-in-case cleanup
process.on('SIGINT', () => process.exit());
process.on('exit', () => renderer.stop());
sleek grove
#

wow, thank you for the explanation and the example for how to use your library @boreal nest, it looks like just what I need to start with

#

though what did you mean by the array portion of the SDK showing incorrect colors if you need to do gamma correction?

#

I don't know much about gamma correction but does it not result in just different rgb values to pass to the sdk at the end of the day

#

also it looks like renderer.init() starts a timer that updates every 100ms by default but I should be able to make it more often by passing a smaller value

#

I'm also a little confused about what kb.leds.autoUpd = true; is doing, is the renderer not also doing that on every update because it calls this.kb.leds.setColormap(this.outmap) internally

boreal nest
#

@sleek grove
The API has an odd quirk where the wooting_rgb_array_set_* functions set the LEDs with inconsistent colors whereas the wooting_rgb_direct_set_* functions do not. It was figured out that this is probably because the array functions bypass some part of the firmware that does the correction internally. The SDK I linked does the correction already so it's not needed with it (ledcontroller.js, the gc() function)

Yes, you can pass a smaller value to renderer.init() to make it update above 10fps (100ms timer) but I don't recommend any smaller than 50ms or so (20fps) simply because I've not profiled how long the drawing code tends to take to run. The way PreciseTimer works is internally it uses setTimeout, and it tracks how long both its own code and the callback took to run plus the actual time since the last call (as timers in Javascript aren't guaranteed accurate) to adjust the timeout for the next run to usually be +/- ~5ms depending on callback size etc. However, if it detects that something caused a spike that caused, for this 50ms example, 120ms to pass since the last run, it will call the calback multiple times to compensate. Unfortunately if the callback is why it took so long, this can result in a runaway issue. It should be fine down as far as 20ms (50fps) because it's Node and not the browser

The things in the namespace of wooting-sdk/* are built on top of keyboard.js/ledcontroller.js. Inside of ledcontroller, the setColormap() function will automatically call updateKeyboard() if autoUpd is set. The renderer doesn't automatically set that in case you want control over when in your code it does the actual push to the keyboard, such as with an animation. Simply call kb.leds.updateKeyboard() during the animation loop

sleek grove
#

gotcha, I'm assuming the wooting sdk devs are aware of the coloring bug with the array_set functions and are hopefully working on a fix for it in the future?

#

that "death spiral" situation you described pops up in game simulations as well, it could probably be addressed in a similar way by clamping the max # of allowed updates per frame and logging a warning if you reach it

#

also looking at setInterval's poor precision in node, https://stackoverflow.com/questions/32587985/node-js-alternative-to-setinterval-which-is-more-precise-for-game-loop mentions using setImmediate (or the nanoTimer library that does it for you)

#

it's important to me because I want my interactive animations to be as smooth and responsive as possible

#

but really the crucial info is how often the wooting hardware can update its LEDs in response to the set_* function calls

#

i.e. what's the LED full-refresh rate of the keyboard itself

#

not sure if anyone here or a wooting team dev knows that from just running tests to update all LEDS as often as possible

boreal nest
#

Indeed. I don't know the refresh rate either. I know it takes a few ms to do the update itself (worst-case, for a full keyboard update, it's 5 separate buffer pushes) at the very least. I had looked at setImmediate but there didn't appear to be a way to use it for arbitrary delays as it sets a timer to be called asap. I should have it push a warning and have a maximum iteration count, you're right

sleek grove
#

another idea that could be borrowed from game update loops is passing in a delta time value for each frame to make movements update-rate independent

#

though that's not hard for the dev to keep track of anyway probably

boreal nest
#

If you're only updating a key or two (or a key and the surround few) it shouldn't need to push more than 2 or 3 buffers depending on how many around and if the key is on the barrier between buffer segments

sleek grove
#

it's probably gonna be several if you want to make effects that move across many keys

#

at least some of the ones I'm envisioning are like that

#

I don't have my wooting two yet but I'm guessing it should be feasible given that it ships with a moving rainbow gradient effect right?

boreal nest
#

Eh, since this is a rendering loop, it's not controlling game logic so rate-independent isn't important.

Yeah, if you're touching keys in every segment it'll be pushing 4 (on a One) or 5 (on a Two) every update

sleek grove
#

which maybe makes use of their own sdk?

boreal nest
#

The effects it ships with are implemented within the keyboard's own firmware. It should be possible to implement the same effects via the sdk

sleek grove
#

well I meant so that it's easy to work with movement speed values in terms of like units/s instead of units/update

#

so everything still moves at the same apparent speed regardless of what you decide to set your render update rate to

#

gotcha, well that gives me hope then

#

if theirs looks smooth out of the box then theoretically it should be doable for a dev to replicate it and be equally smooth

boreal nest
#

You can do that still. If you rely on the renderer's timer, it'll be entirely independent of your update loop, so you can update the layers as fast or slow as you want

sleek grove
#

ah, yeah I think we're saying the same thing

#

I didn't mean having two separate loops for updating vs. rendering

#

I think that's kinda overkill for this case and you could get away with just doing everything in the render loop

#

and multiply stuff by the render time delta to make it consistent

boreal nest
#

Basically the renderer's flow goes like this:

dev updates layers independent of any internal timings
Renderer's timer kicks in, flattens layers into its internal buffer
It then updates the sdk's buffer (since the renderer's buffer is layed out entirely differently)
If autoUpd is set, that sdk buffer update will trigger it to be pushed to the keyboard

#

The sdk's internal buffer is split into the segments and so only segments that actually change in some way are flagged for being pushed, so it only needs to push a subset

sleek grove
#

oh right, the dev's setInterval is completely decoupled from the renderer's own timer

#

hmm

boreal nest
#

Yep. You don't have to use the renderer's timer though. You can skip the init() (as all it does is set up that timer) and call the renderer.run() function manually

sleek grove
#

would it not be nice to provide a callback that runs just before the render is about to set the color map

#

or you could do that I guess

#

I didn't realize init() was literally only to setup the timer

#

so it's more like a start() really

#

e.g. you could call it again after calling stop() to start up the timer again

boreal nest
#

You can also do that callback approach by something along the lines of class customLayer extends Layer { tick() { /* update the layer in here */ } } as every layer is tick()'d before the flattening step

sleek grove
#

in fact the loop for calling the renderer's functions seems like it could be a separate responsibility since the renderer shouldn't necessarily be concerned about that

#

I might go with that approach

#

lol I'm getting too much into architecting the code for these dumb little LED toys

boreal nest
#

But the tick() approach means you're bound by the renderer's update speed. And yeah, the renderer's init() is more like a start() but it's named that way to be consistent with everything else using init() to do actual, proper initialization of stuff

sleek grove
#

yeah

#

imo the timer stuff and stop() isn't directly part of rendering, I guess it's there for convenience

boreal nest
#

You could even skip using layers/the renderer at all if you want. Those are there more for convenience than necessity. Layers can have transparency per-key, so it's convenient when you want to stack multiple effects (or have the capslock etc keys show on top without extra work)

sleek grove
#

yeah those abstractions make sense to me

#

I was trying to think of what a layer meant at first and then I realized it was like image layers that blend with each other

#

I like that they're customizable and like you said you provided a way to get standard things like lock colors and such

#

so you have the choice for whether to add them in or override them temporarily

boreal nest
#

You can have more fine control over the lock colors as well, independent of what the user's profile says, too. The Toolkit tracks caps lock, num lock, scroll lock, fn lock, and winkey lock. By default, scroll/fn/winkey use the caps lock color, but you can change each them via kb.leds.profile.fnLockColor/winLockColor/scrollLockColor (as well as the other two via capsLockColor and fnLockColor). Changing these only changes the internal stuff and doesn't affect the keyboard, so it's safe to do so

sleek grove
#

nice

boreal nest
#

But be aware that the user changing profiles (via A1/A2/A3/Mode/etc) will overwrite those changes, so you'd want to re-alter them in the profileChanged event

wet knot
#

You would have to click save

#

on each profile to prevent changes

boreal nest
#

Not talking about the Wootility :p

#

There might be a better way to track the locks than what I do. Similar to the example, Toolkit watches the analog values for the locks to trigger it. This can sometimes end up triggering, for instance, capslock without triggering it on the layer if it's pressed down just far enough and the Toolkit doesn't get an analog update that says it was pressed. It's rather uncommon, but something I need to figure out a good solution for

#

So the layer will say caplocks is off while it's actually on, and result in it being flipped until the app is restarted. This method of tracking also means that if the app is started with any lock already changed, the Toolkit's state won't match the keyboard (it assumes all locks are in their normal off states, except numlock which it assumes is always on). If you know of a better cross-platform way to track these, let me know

sleek grove
#

can't node query the OS for this info directly

boreal nest
#

Sadly no, not that I could find

sleek grove
#

or provide a callback for the event when the state changes

#

weird

#

that's disappointing if true

boreal nest
#

Couldn't even find a Node module for querying anything about caps/scroll/numlock states

sleek grove
#

I see a keyboard.isCapsLock() in the example

#

given that it's 5 years old I wonder if it still works

boreal nest
#

Watching the analog should be fine, as it uses the same actuation point setting as the user has set in their profile. But race conditions and such between the keyboard's firmware and the output of the analog API can mean the firmware saw the capslock key pressed far enough while the API didn't. Forgot to mention, semi-related, that the Toolkit only updates internal states when the profile has digital keys enabled and like the keyboard's firmware, doesn't turn off lock keys in profiles that have digital keys disabled

#

Yeah, that's specifically Windows though. I'd need something cross-platform

sleek grove
#

oh right

quiet root
#

well sad that webjs has a function to qiery modifiers while nodejs doesnt

#

best would be to build some universal external tool that outputs true or false to stdout and just get that with the nodejs process

boreal nest
#

That's a lot of effort. I'm not a Windows or Mac dev, so wouldn't know where to start. Either way I'd have to stick to the analog watching approach for fn lock and winkey lock at the very least 'cause they're in the keyboard itself

knotty night
#

Just did some playing with the analog API and AHK, and I think maybe that previous reports some people made of "delayed" API input was erroneous

#

My guess as to what they were seeing was that sometimes a hook hotkey may fire before something using the analog API, if you are eg polling the API in a 10ms loop

#

initially I was sometimes seeing large "delays", but it turned out to be instances where the AHK hotkey fired before the analog API, and the benchmarking code was comparing to the last time the key was pressed, not the current time

quiet root
#

microsoft is seriously getting p dope

#

idk what happened but for some reason they get more and more into open sourcing shit

fathom garnet
#

and even a marketing video for it vvThink

hybrid lake
#

That is sick

#

Microsoft is doing an amazing job lately

#

React native for Windows too

#

Seems like react native has a very bright future

#

microsoft is cool again

hearty yacht
#

@hybrid lake say that to my lost files form the windows update

#

or the bricked pcs' because of av software

#

or the people whoi failed to update because they have a usb plugged into their machine

#

microsoft is still not cool

chilly oar
#

They make something right and another thing false, so they become better because at least they don't do all things in a bad way. 😃

#

The terminal support tabs??? Never see it in action. How does it work and look like?

balmy iron
#

And the .NET stuff seems neat, can't wait for all websites to load .NET for even more memory usage..

quiet root
#

m8 webassembly is were its at

#

@hearty yacht u see ure flaming on this onr product they are most known for but if u look into their github account they have a shit ton of repos of awesomeness

#

this is loke hating on pewdiepie for the few times he fucked up big time but never mentioning that he donated millions to charity

#

not saying that m$ and pewdiepie never did wrong but always just blaming them for 1 or 2 products/things they did wrong is not ok

balmy iron
#

Yes it's that fancy WASM thing

balmy iron
#

But oh well, guess not having to write JS requires sacrifice 😃

quiet root
#

well its supposed to run quiet well from what ive heard

#

havent tested it yet

chilly oar
#

Did someone else had the problem that the LED handling breaks after sending a command to the keyboard?

I use this to change the current profile and apply its colour, but every single command kills the LED handling so I have to replug the keyboard so it can work again.

#
wooting_usb_send_feature(0x20, 0, 0, 0, 0);      // 
wooting_usb_send_feature(0x17, 0, 0, 0, 2);     // ActivateProfile (use analog profile 2)
wooting_usb_send_feature(0x07, 0, 0, 0, 2);     // LoadRgbProfile (use colour from analog profile 2)
#

Normally it should work just fine and it did before (a few weeks ago) but now it don't. Even if I only use one command of them the keyboard don't changes the colours even by changing the profiles with the shortcuts.

quiet root
#

ask @clear hedge

#

he had the profile changing thingy

chilly oar
#

Never mind... I forgot that the Tachyon mode is active. But it's still strange and should work.

chilly oar
#

I was to fast, even with Tachyon disabled the LED don't work after applying the commands.

quiet root
#

idk yesterday it worked for me when using the profile detector thingy

#

only crapped itself when closing cause no disconnect call

wet knot
#

@quiet root he stopped working on it

quiet root
#

uh....

#

i shall not disclose the things i know then

#

ill only say itll become way better soon

wet knot
#

Well technically you just disclosed it

#

@clear hedge sue him

clear hedge
#

Nah, tiny basically has all rights to it XD I'm only going to make what he does prettier

#

Joint ownership 😜

wet knot
#

Ah then I'm still right

#

Kinda

clear hedge
#

If I sued him, there would be noone to update the code XD I have too many things happening 😂

boreal nest
#

Hmm... has anyone profiled how fast writes to the keyboard are? I'm seeing 7-15ms per array buffer write (averaging ~12ms/ea), for a total of 50-60ms per full keyboard refresh

chilly oar
#

I found the problem with my code, due to some test that I have done before I changed the command and don't update the comment and forgot about it. Shame on me... 😦

wet knot
quiet root
#

does anyone know if the wooting uuids are all uuid v4 values?

#

like it looks like idk what uuid version

chilly oar
#

The Wooting itself don't have a UUID.

quiet root
#

the profiles i mean

chilly oar
#

Ahh, so I can't tell.

quiet root
#

e97c2524-c7d3-c3c1-0148-8df1735dee09

#

this for example follows no uuid format

#

at all

#

which is what confuses me

#

really confused cause in the minfied source it calls a function Bi() which i cant even find anywhere else in code

#

usually a uuid follorws the format xxxxxxxx-xxxx-Mxxx-Nxxx-xxxxxxxxxxxx

#

where M is the version (so a number from 1 to 5 currently) and N's 3 most significant bits should be the variant iirc

#

so either 8, 9, A or B

#

and thats all defined by rfc spec btw

#

so idk what weird generator the wootility uses

#

maybe @hybrid lake can shed light onto this

hybrid lake
#

We used V4 on both I think

#

It was made a long long time ago

quiet root
#

ew the guid module

#

ok but at least it explains why the older GUIDs dont follow any spec thanks

civic steppe
wide nymph
#

! Thanks

civic steppe
#

np

chilly oar
#

@hybrid lake I'm not familiar with JS, so this code is maybe not 100% correct and it's just a quick brainfuck from me...

It should fix the missed key events for the pressed keys in the Wootility. It seems to work on a normal browser, but I can't test it in the Wootility direct.

// The element for the output
const log = document.getElementById('log');

var keys = {};            // Holds all the key states
var lock = false;        // Semaphore to lock the function 
var change = false;        // Indication if a possibile change was happen during execution

// Catch the keypresses
window.onkeydown = function(e) { keys[e.code] = true; logPrintKeys(); }
window.onkeyup = function(e) { keys[e.code] = false; logPrintKeys(); }

// Logging the pressed keys to the output element
async function logPrintKeys() {
    var pressedKeys = "";

    // Allow only one active instance
    if (true == lock) {
        // Mark that a possible change is occured
        change = true;

        // Let the main instance do the work
        return;
    }
    
    // Lock the function
    lock = true;
    
    // Handle every possibile additional change after the main instance has already started
    do {
        // Reset everything
        change = false;
        pressedKeys = "";

        // Only add the current pressed keys
        for (var key in keys) {
            if (keys[key] == true) {
                pressedKeys += key + " ";
            }
        }

        // Print out the pressed keys
        log.innerText = pressedKeys;
    }
    while (true == change);
    
    // Unlock the function
    lock = false;
}
hybrid lake
#

So what happens when it misses? I saw your other message and it doesn't involve a delay, it sets a timeout

#

Meaning it will execute that function after a delay

#

So too fast presses it might miss the keyup event right?

hybrid lake
#

Nvm, I see what happens

#

The up handling is delayed, so if there's a down in between it will just get removed again

quiet root
#

pls dont use var

#

like never use var unless absolutely necessary

#

use let

lyric zinc
#

or const but when in doubt, let is simpler.

quiet root
#

na u use const when u know.ure not reassigning the value of the var

quiet root
#

?

#

common knowledge

#

const whenever u dont reassign the value

#

let for everything else

#

and var only if u really really need it and know what ure doing

fathom garnet
#

I mean using const if you dont reassign the value is something you hear in the first 5 lections of C++

balmy iron
#

Yeah probably, although the let and var thing was new to me, seems like let is the way to go because var has braindamaged scoping

little monolith
#

@fathom garnet not like it's going to let you compile it anyways bitch

fathom garnet
quiet root
#

@balmy iron exactly and many dont know about the scoping part

#

and then they wonder why shit breaks if the put a var in an if and try to use the same var outside and the value is some garbage they dont expect

#

thats why u only use var if u actually know what ure doing

#

var if function scoped no matter in what block it is inside the function

#

let is block scoped and can only be accessed in deeper blocks

chilly oar
#

@hybrid lake Why do you have an additional CRC checking on the configuration & RGB interface? Because this interface is based on an interrupt endpoint, so the error checking is already done by the controller. As far as I know only on an isochronous endpoint a custom error handling should be done.

hybrid lake
#

The original USB interfaces were not done by me, so I'm not a 100% sure. I think it's because the guy that did it has an embedded background, where it's normal practice

#

I think we'll remove it at some point

placid ledge
#

Yo, is anyone aware of a way to figure out the mapping the OS uses to translate the keyboard HID keys to the locale based keycode/scancode?

#

I've tried VkKeyScanExA, GetKeyNameTextW and MapVirtualKeyA but none of them work for me for getting the locale based key for the code I give

#

i.e. I'm looking for something that'll allow me to make a mapping from HID Q -> Keycode A in the French layout.

chilly oar
#

In theory I guess it works something like this.

You have the key code, you need to get the current locale layout which is set in the OS and make your own mapping for the character you want.

#

You don't have an locale scan code, the scan code is universal, you only have an different key for it depending on the locale settings.

#

I don't know if there are some specific reserved scan codes for some keys or how it's handled for the nKRO keyboard interfaces.

#

But for last one I guess it works the same, so the key naming for the bits are just an representing for the standard layout names.

placid ledge
#

Hmmmm

wet knot
#

Hmmmmm

placid ledge
#

El Hmmmm

#

What I'm trying to do is to be able to be given the key that inputs Q, and get the HID code that would've sent that

#

As Q can't just be always mapped to the location of Q on the standard layout, as it depends on the locale setting

#

So if you're using a french layout, pressing Q is the A key on the standard layout, which is what I'm trying to find, so I need some way of getting which physical key has to be pressed to get a particular input

#

But I'm struggling to find anything that can help with this

#

At least for windows

#

Okay, looks like I've found something. For those curious, using MapVirtualKeyEx(key, MapvkVkToVsc, layout), with layout obtained from GetKeyboardLayout, it seems to do the job for getting the scan code pointing to the physical key that input that key

chilly oar
#

I don't know there you are, like the language, which libraries you use and what the function is.

I would expect if you have a function which returns a scan code for the current pressed keys, that these are the scancodes from the keyboard which are send over USB, like before the locale thing is applied. If you get a key character it's most likely that the locale is applied.

If you want to get the scancode out of a pressed key you can create a reverse map for the locale.

placid ledge
#

Yeah, what I've found should allow me to find out what HID/USB keycode the keyboard sent to the OS to produce the particular VirtualKey

#

The scan codes aren't identical to the HID ones, but it's easy to make a mapping between them

placid ledge
#

Anyone who uses the Analog SDK, do you use the read_full_buffer function, if so, for what purpose?

knotty night
#

I don't use the read_full_buffer tho

#

That code attempts to translate wooting row/column to ScanCode

#

There's also code in that project which should in theory be able to get localized key name from ScanCode

placid ledge
#

Cool, thanks

#

If you want I can send you the code snippet I've got which can translate the Windows VirtualKey to the scan code independent of locale

#

If you didn't see, I'm redesiging the Analog SDK, so if you've got anything you want to see lemme know

#

The code snippet I mentioned I've got should solve the locale issues I think, at least for Windows. WIll take a bit more work for other platforms

placid ledge
fathom garnet
#

good guess, this is looking solid

#

not familiar with rust so I like still having other options to use it, while it will use the most efficient language

chilly oar
#

It's not looking to me that it will support multiple keyboards yet or how would you handle it?

#

I'm confused how you want to identify the keys, by scan code or by a charachter?

#

There???

#

I don't see such a paragraph.

placid ledge
#

@chilly oar Multiple devices are able to be connected with this design, but you wouldn't be able to interface with them individually

chilly oar
#

You wrote about key code, scan code and character. The key code is bad because it only rely on the manufactor. Normally the OS identifys a key on the keyboard by the scan code (6KRO) or the HID keyboard usage definition (nKRO) which I refer here as scan code too. So you don't really need to look up for the key for a character at all, because you have access to the key. So you only need to get the character for a scan code to display the key for the binding, so only for UI.

The problem is that games mostly rely on the abstraction layer of the OS, so they normally use characters instead of scan codes. So do you want to use scan code or characters to differ keys, or both?

How you want to handle and differ multiple keyboards? There should be an option to address them.

placid ledge
#

For identifying the keys it's HID code by default

chilly oar
#

So please add the support for multiple simultaneous keyboards.

placid ledge
#

Also, it'd be cool if you post on the issue as well so your thoughts on the matter don't get lost to the discord history

#

With what you're talking about with the keycodes is what I discussed in the "Differing keyboard layouts" section if I understand what you're saying correctly

#

And have a look at the 'keycode' enum in the 'Proposed API' section

#

For the multiple simultaneous keyboards, are you talking about if you wanted to inteface with multiple different Wooting Ones(for example) individually?

#

I think that could probably be solved by having an optional parameter to the read function which is the device id and include device id in the device info struct?

chilly oar
#

You need to add an identification value. So the first point is the serial number value from the USB enumeration (for the Wooting the serial number WOOT_00X_SERIAL_A-XXX), then or as an alternate an individual differentiation by the manucfactor (like the serial number from the API or the firmware version so a differentiation can be done by some characteristics on the device) and by last at the ID (position) at the eneration.

#

Multiple Wooting and other keyboards mixed up.

placid ledge
#

Okay, I think I see what you're on about. You're saying you'd want to see any of those as an option to indentify the device you want to directly interface with?

chilly oar
#

There should be an identification value on the struct device_info, so the plugin can / has to provide it. I don't really know how you would handle multiple ABI at once or multilpe access to it. But for the current SDK I would add the keyboard handle to every function.

placid ledge
#

Okay, sounds good

#

Did the bit I said related to the keycodes sound about right or is there a bit more that I'm not getting from what you said?

#

And would read_analog & read_full_buffer be enough for adding the keyboard handle param? or would you want it on other functions/how would you want it to work on those?

chilly oar
#

For the current SDK I thought about a function which gives me all the serial numbers from the USB information (hidapi is capable of it). Then I changed the connection function so it returns the keyboard handle. So I call every function with the handle for the keyboard I want so use.

#

The whole stuff can still be complicated to understand... I think the best thing is to make more diagrams on the meta layer how things should work and which are the goals.

#

Personally I would love to see an API like DirectInput. So you can see which controller is connected and that the capability of them are, like the precision, the range and number of keys.

#

Right now I don't rely know how the link looks like. I assume the SDK looks at a special possition on the RAM.

#

And which module runs at which time? How are the plugins loaded and which module should be loaded at whcih time?

#

Even the term key code is different depending about the current scope. So a defination is necessary in my opinion.

For me the key code is the number / identification on the Wooting keyboard for the key. The scan code is the universal code for every keyboard the same.

placid ledge
#

That's a good point including the capabilities of the devices in the device information. If you seen the wee comment I made on the struct definition it should be easy enough to add more information to the struct, so we can add that kinda information without breaking anything down the line

#

The wrapper loads the sdk from the system and the sdk loads the plugins when it's initialized

#

Yeah the keycode term can mean so many things. As I mentioned in the post and earlier the HID usage keys are the way to interact with it, and you can see the other sets that I mentioned which are all universal ones and not specific to wooting

#

With the basic proof of concept I've written already I'm using a different firmware version which reports the codes as HID usage codes rather than that specific wooting scan code set which it was before

ornate zephyr
#

Something else you should consider is how a single keyboard might control multiple applications cleanly. For example, it would be useful to be able to query the keyboard for the currently selected keyboard "profile". This would allow a user to be able to control one application while using "Profile 1" and control another application with the same analog keys while using "Profile 2" for example.

chilly oar
#

This should be done in the Plugin in some way and transparent to the SDK.

placid ledge
#

Hmmmm, that's a good point. It'd definitely be worthwhile to have the profiles interact with the SDK in some way

#

Off the top of my head, I think it could potentially be done nicely by having the intialize function include or get the process name, and the plugin can use that to switch to a profile that is linked to that name potentially?

#

Considering the fact that the Profiles are not likely to be always supported by the hardware, I'll have to have a think about how it could be integrated nicely into the SDK

#

It's also important to consider the fact that at the moment, the profiles don't change anything for the analog information given by the keyboard atm (afaik)

ornate zephyr
#

What I was thinking was some value that the SDK can manage like "slot" or "profile" so that it would be possible to hide the analog values from applications that may want to share the keyboard. Hypothetically, let's say I am a Power user that uses CAD and Photoshop and I need to use both software at the same time. I want to use WASD to manipulate a 3D object and I want to use W/S to change the brush size in Photoshop. But, I also want to use WASD as normal digital key presses. The user is likely going to need to control when they are using WASD for analog functions or for digital functions manually because it would be difficult for each application to know the intent of the user. This is currently done by profile switching on the keyboard. If this information is communicated to the SDK then the application can be informed that the device is using "slot" 0 and to ignore any analog values, but as soon as the device is using "slot" 1 it will read in the analog values and control what the application has been configured for. Likewise, having this type of value would prevent interaction in other applications. Unless the SDK is going to only send analog values to the currently active application (which could be a good thing or a bad thing for some users), then you could run into situations where two applications are up on two monitors and the user presses the analog "W" key and it simultaneously manipulates two things in both applications at the same time. However, if the user controls the active profile then application 1 would only respond to analog values if the SDK is configured with "slot" 1 and application 2 would only respond to analog values if the SDK is configured with "slot" 2. I can see this type of scenario being used with music applications and video editing applications used at the same time for example.

placid ledge
#

I understand the usecase you're describing here, but I don't think it necessarily makes sense for this to be the SDK's job. As theoretically we're talking about something which doesn't apply unanimously to all keyboards (as this SDK is for all analog keyboards, not just Wooting). So I think that it is something that should either be handled by the keyboards software, switching profile when a certain application is in the foreground, or, which might actually make a bit more sense, it's handled by the Application itself. Presumably you're going to be configuring how the analog keyboard works in the particular application, inside that application, as it is the one that integrates the SDK, so it is the one where you configure how it acts for that specific application, rather than switching keyboard profiles

chilly oar
#

I think a scope handling to differ multiple access to the SDK should be a part of the SDK, the question is in which way.

So what should happen if multiple (different) application are using the SDK? Should only one program at the time have access to the inputs (the current active one) or all? Should it be possible that a program can claim a dedicated unique access, so it can get inputs alone even if another program is active and want access too?

placid ledge
#

I can't think of a reason why you'd want to have a dedicated unique access for the SDK. Why would you want to prevent access by other applications? For multiple access, theoretically it should just work fine as all that's being done is reading the usb usage report, Jeroen said he tested it on the existing SDK and multiple apps could access without an issue.

chilly oar
#

I won't, I just ask for which circumstances you are prepared off and how you would handle it.

#

But yes a unique access isn't normally a good behaviour and the application should handle on its own if its want to register inputs even if it's not active.

ornate zephyr
#

It should not be required for the hardware to use profiles, but I think the SDK should be able to provide this information to an application if the hardware provides this information to the plugin. All the analog keyboards on the market now support hardware profiles. If future analog keyboards don't, then just pass a "0"to the application. Look at the MIDI standard for reference. A single hardware device can provide multiple unique "analog" values provided by the same knob or dial of the hardware to different applications using "channels"

placid ledge
#

What is the thing you actually want to achieve with the hardware profiles though? All the keyboards may support them, but what they do on the different keyboards may not necessarily be the same. Right now the profiles don't change the behaviour of the Analog SDK at all. given te fact that the keyboard profiles may work differently, wouldn't it make sense for any profile/application specific configuration you want, to be done on the application side so that the behaviour is consistent across all analog keyboards?

ornate zephyr
#

What I'm proposing is that you provide a way in the SDK to help applications be aware of what is happening at the hardware/plugin level so that unintended actions don't happen in applications. I'm not proposing that hardware profiles change the behavior of the Analog SDK. I'm proposing that in addition to the analog data you also send some kind of profile/channel/slot indicator to the Analog SDK wrapper. This way, the Analog SDK wrapper can be configured so that if it receives analog data it can determine if the application uses or ignores the analog data. For simplicity let's just say the users presses "W" 75% of the way down generating a .750 value for the "W" key. There are two applications that are configured to process this "Analog W" signal and both are currently running. Does the user want this action to make a change in Application 1, in Application 2, or both, or maybe they really just want to send a "W" key press? How can we determine user intent? By adding a "channel" value it at least gets close to understanding the intent. For example a channel value of "0" could mean both applications would process this change. If the "channel" was "1" then only application 1 will process this change, and if it is "2" only application 2 will process the change, and if it is value 255 then the analog value would not be processed by any applications and would instead just send the "W" key press to the OS. The user could control this through hardware profile changes themselves, or the plugin could be configured to monitor which application is "active" and send this information to the SDK to be passed through to the appropriate application.

placid ledge
#

Shouldn't the application reacting to the input be completely based on whether the application is focused or not? When would an application in the background be using it? And if it needs to use it then it can use it, if it doesn't then it can just use it when it is in the foreground. If we were to pass this 'channel' information, how would the application know how to react to which number? Configuration in the application? If that's the case, why doesn't the application just configure itself to handle it whether it is the in the foreground or not? That's how input is usually handled, background applications don't normally get key presses unless they go out of their way to get them.

#

You're going to need to give me a real world use case which wouldn't be achieved nicely through the existing design for me to understand the necessity for something like this

chilly oar
#

The descibed channel isn't a good thing in my mind too, but to provide the current profile like descibed at first maybe not. But I can't think of a big feature so this should be a must have to implement.

knotty night
#

If an application registered with the Analog SDK to receive key events, it should decide itself whether to process them if/when they happen

#

I don't really see the need for profiles at an SDK level

#

However, saying that, I do see a use-case for there to be some link between the analog SDK and digital key events. eg it would be cool if the analog SDK could be instructed to block the digital version of the key

#

Or at least for there to be a digital SDK that understands same keycodes as analog SDK

#

So eg if writing a remapping app using the SDK, the remapping app can decide "Analog mode for W key is on, so I want to suppress the digital version of the W key so the game does not see it"

#

You should be able to easily toggle it on and off tho, so eg if the user opens a chat box, you want to re-enable digital W so they can type

placid ledge
#

Hmmm, that sounds like something that could just be done on the application side, if it is reading analog input for keys it shouldn't be reacting to the digital version of that key

chilly oar
#

I don't think to disable the digital keys via the SDK it a good thing at all. It would take away the control from the user that don't like. You can't make sure that every application takes care of it in a good way. The user should decide if he wants to enable the digital keys on the keyboard or not (like by choosing a profile regardless if it's set manually or via an automated profile loader). So even if the game only uses the analog values, the OS should handle the digital keys in the background after all, as long as the user has enabled them.

chilly oar
#

So I think the game should handle the analog values independent fom the digital ones, like some games do it today with the Xbox controller. To have a different binding set for digital keys and analog keys, there only the bindings for one of them are active / used for the input at the same time. So as long as the app registers the last command as analog, even if there was a digital key send or not, it should still using the analog set. But if there was a digital key registered without the analog value, the game should change the mode. Like the games there you can't use a Xbox controller side by side with a mouse. It would not be a problem to forget or handle the inputs wrong between a change of the input modes.

Even in the analog set, the app should have no problem to handle typing, because if the game registers the chat key it can activate the digital keys from the OS again or handle it via the analog value itself.

lofty thistle
#

Was analog SDK changed in a breaking fashion?

#

I received reports that GInput Wooting stopped working ¯_(ツ)_/¯

placid ledge
#

Analog SDK hasn't been changed yet

chilly oar
#

@lofty thistle The firmware was changed, it now expose the serial number via the USB device describtor. But this shouldn't break anything.
Because of that there are now two different sets of device informations in the Registry, but this should not break anything either.

lofty thistle
#

Good to know - I don't own the keyboard so I can't test it, just relaying the info I got

chilly oar
#

So as long as you didn't have changed the SDK, it should be fine.

chilly oar
#

??? As long as Wooting don't changes the firmware in a way which breaks the current SDK it doesn't matter that there will be a completely different version comming.

#

So now you will do...
It was wrong and I pointed it out. So you are welcome 😀

wet knot
#

Play nice children

hearty yacht
#

😢

eternal tangle
#

Whether Russian layout is possible on this keyboard?

hearty yacht
#

If you're just switching keycaps then yes.... Other than that I have no idea what a "Russian layout"

#

Also I think this is the wrong channel for that type of question

surreal knot
#

also asked in like 4 channels

chilly oar
#

But he ignored the right one (question_answers).

eternal tangle
#

Excuse if strongly disturbed someone)

placid ledge
#

@chilly oar The firmware will be changed in a breaking way (for the old sdk) for the new sdk, as it needs a slightly different analog report

chilly oar
#

@placid ledge The change on the SDK which breaks it was long time ago and Silent should only has used the newer verson, because at the time the code challenge was on, the SDK was already changed.

If I'm right the reason was because the usage (page) number was changed. It used a reserved number, like the configuration interface still do.

placid ledge
#

Well, all I'm saying is that the firmware is going to change in the future for the new sdk, I don't know what the story is with Silent's situation

chilly oar
#

Now it uses the order of the interfaces and no usage number, so it works with both versions.

#

Maybe, we will see...

#

To be honest, I don't really see a reason why the firmware should be changed for the new SDK. The current SDK will just become the plugin for it. The Wooting uses it's own index for the keys, so I don't see any problem.

#

I don't really think to change the index to a scan code is really better, because the index for it should be distinct anyway and not rely on the binding of the keys at all.

lofty thistle
#

Also this is probably the best place to ask it evenif not directly related, in order for Aurora SDK to work Aurora app needs to be installed?

#

or the SDK also wraps to other vendors so eg. having only Logitech Gaming Software installed it'd still work?

sleek grove
#

is there a way to add custom RGB fx that will show up in the wootility?

#

seems unlikely but thought I'd ask

fathom garnet
#

not in the wootility directly but you can use the sdk to make your own rgb effects

sleek grove
#

yeah I guess I'll go with that approach

fathom garnet
#

there are already some ways to use the aurora project simon made to, maybe thats enough for what you want

sleek grove
#

I looked at it briefly but it seemed designed for infrequently changing color layouts for games

#

but I should look again

glossy dagger
#

is there an ETA on a wooting two-compatible version of the SDKs? i was able to get them to work decently by changing the PID and rebuilding, but there are some slight issues (in particular, RGB seems unable to set the colors of the "extra" keys)

strong siren
spare cosmos
#

When I run the basic node example, it is saying "Keyboard not connected" (but it is connected). I tried reconnecting it, and running it with Wootility both opened and closed. Maybe I am missing something

chilly oar
#

@spare cosmos If you have a W2 I would bet that the dll that you are using can't handle it and only support the W1.

spare cosmos
#

Oh that makes sense. Is the RGB SDK not available yet for W2?

chilly oar
#

The whole SDK thing will be re-created at the moment.

#

So, as loong as you don't want to build it by your own you must wait.
There are some folks for the SDK which addresses the W2 connection already.

#

I checked it, the code is updated for using the W2 but you need to build it.

spare cosmos
#

So maybe only the analog is updated, but not yet for the RGB

chilly oar
#

Yes, there isn't the PID included for the W2 in the RGB SDK.

spare cosmos
#

Aha, perfect! Thank you :)

spare cosmos
#

The only thing that isn't working is the last 4 columns (numpad area)

strong siren
#

they do in aurora afaik

spare cosmos
#

Exactly what I needed. Thank you!

strong siren
#

👌

hybrid lake
#

We're thinking about setting up a static website generator (i.e. jekyll, hugo) for our help docs, so people can add / edit docs on github. Anybody got some tips about best framework, setup for help docs etc?

#

Goal is to just have a bunch of markdown files

hybrid lake
wet knot
chilly oar
#

Can someone help me with analysing USB data with "Microsoft Message Analyzer"? I can only see the logs but not the actual USB data. And unlike the instruction video, I can't expand the fields I want to investigate, because they don't even have the expland symbol on it.

wide nymph
#

@quiet root Are there any fixed variables in the tool? Or regardless of registered devices it will remove them all.

quiet root
#

it will remove the woot devices

#

well any device that starts with VID_03EB&PID_FF0

#

this is a quick write up mainly to get the ball rolling in terms of making this troubleshooting option easier

#

still have to test the deleting part

#

moved here for sake of validation etc

#

@clear hedge

wide nymph
#

And @hybrid lake to double check.

quiet root
#

i think i brainfarted this

quiet root
#

actually throw that code away for now

quiet root
#

welp am not home anymore

wet knot
#

?

clear hedge
#

TinyVampAFK confirmed 😛 @quiet root

quiet root
#

why

#

im not sure if the only thing im missing was a proc.StartInfo.Verb = "runas";

#

because devcon tries to remove em but it always fails for some reasob

#

reason*

#

anyway i can work on this in 3 weeks or so when im back home

#

maybe even making a gui app with multiple troubleshooting buttons

#

@clear hedge sorry dad

clear hedge
#

@quiet root I will write the guide up without using that program for now, if thats ok ❤

quiet root
#

ofcourse

#

was just a thought thrown into the room tbh

clear hedge
#

would be great, so those who arent happy playing with regedit, a program to do it for them would be great 😛

quiet root
#

ya

glass radish
chilly oar
#

Yes it would be possible, kind of.
Not a real sleep mode but it would be possible to create a program as a service which reduces or disables the backlight LEDs, like when the monitor goes to sleep to.

#

And of course specific for the OS it's created for. As far as I know you can't register the screen suspend with JavaScript directly, so this feature can't be implemended directly in the Wootility and it would need external utilities to archive this.

placid ledge
glacial horizon
#

Nice work!

placid ledge
#

Thanks!

fathom garnet
#

might take a stab at it after devcom/gamescom week is over

snow bison
#

it's build with rust? cool, what's the advantage of using rust for an sdk like that?

balmy iron
#

It's the hot new trendy thing to write everything in because it's ~safe~

snow bison
#

compiling rust code takes ages.. but oh well, if it does perform better i won't care too much

#

just curious if there might be a more specific reason for it

placid ledge
#

imo rust has: memory safety, pretty fast and isn't a complete mess like c/c++ as it has a consistent, modern, x-plat standard libs

#

Initial compile for rust projects takes a bit of time, as it has to compile all the dependencies, but any subsequent compiles are pretty speedy

snow bison
#

if you work with a package manager this must not hold true (subsequent compiles) as the sourcefiles will get deleted

placid ledge
#

I was talking more from a dev working on it perspective

snow bison
#

but ok, the 'usual' arguments 🙂 I will try to compile it on crux (linux derivat) later today

placid ledge
#

Noice, let me know how it goes

snow bison
#

will do

#

any plans on including rgb sdk in there at some point? that's what I'm more interested in tbh 🙂

balmy iron
#

I'm really not a fan of the micropackage trend, adding one dependency and wham your cargo build now pulls in 400 crates yaaayyy

placid ledge
#

The rgb sdk is intentionally separate as it's for just wooting, whereas the analog sdk is for more than just wooting kbs

#

for me, that issue is fairly minor compared to the amount of things that rust does better imo

#

It's not perfect, I've ran into some headaches, but I've found it to be one of the better overall development experiences I've had

snow bison
#

so, any plans to rustify the rgb sdk? from what i read on github, it's not really working on linux as of now?

#

i haven't tried it out yet, tbh

placid ledge
#

It'd be nice to do the rgb sdk in rust, but it's in need of it's whole own restructuring so the language might end up being whatever makes sense for the setup it ends up in

#

The rgb sdk should work on linux, I think the main thing was not having makefiles for linux

snow bison
#

there was a pull request for that, i would try that approach

placid ledge
#

Yeah, there's two linux related prs

snow bison
#

but i am not sure yet if i have the time to work with it.. i am not skilled anyhow, so this would be novice project at best anyway

placid ledge
#

It's always fun to play around with things

#

Never know where it could end up

snow bison
#

exactly

#

while i like the wootility, i don't like having to use an appimage really. that's why i wanted to try and make something with ruby/gtk3 to control rgb lighting, but who knows how well this could work out

placid ledge
#

Ah, one thing to note is that wootility saves the kb lighting to the firmware, whereas the rgb sdk just sets them temporarily

snow bison
#

ah, haven't thought about that, but for a script solution i think i like that better anyhow

#

replugging should reboot the board to a known good state, right?

placid ledge
#

Yeah, afaik

#

Or if shits real fucked then you can reset it through the steps in wootility

snow bison
#

i see, cool

#

well, let's see if i can dump some time on that

snow bison
#

@placid ledge "test result: ok. 0 passed; 0 failed; 1 ignored; 0 measured; 0 filtered out" 😄 but it builds, not the test app though, since I don't have dotnet-core

placid ledge
#

Ya, there aren't many tests, difficult to do unit tests on something which depends on plugins, and the plugins depend on physical hardware

snow bison
#

i see, cool anyway! great work man

placid ledge
#

Thanks!

old reef
#

@placid ledge hi,when can SDK support Velocity-Sensitive?

Iike this:
Aimpad - Analog Gaming Keyboard Technology https://aimpad.com/
https://thumbs.gfycat.com/VelvetyFirmGallowaycow-mobile.mp4

......

You can control variable MIDI musical devices,
If a low amount of light is reflected we know that the key is at its highest point.
If a higher amount of light is reflected, we know that the key is moving closer to the sensor.
Control the loudness of a note based off how quickly the key is pressed

Thanks alot!

placid ledge
#

Ultimately, it's up to the device manufacturer to support the SDK, as we don't have access to the inner workings of the device to be able to support it

old reef
#

@placid ledge hello, I have bought a wooting two and I want to play piano music with Velocity-Sensitive on it.

placid ledge
#

Is Velocity-Sensitive an application or something? I can't find much information about it

#

Application support isn't really in the scope of the project atm, as we're still working on getting it ready for a full release

old reef
#

Keyboard expression - Wikipedia https://en.wikipedia.org/wiki/Keyboard_expression

and the soft : play piano or other musical instrument with freepiano
Free Piano download | SourceForge.net https://sourceforge.net/projects/freepiano/

download:
FreePiano | Advanced virtual MIDI keyboard https://freepiano.tiwb.com/en/

FreePiano is an opensource software that can let you play music with your computer keyboard.

Please download it and try playing with wooting two an wooting two lekker.

Just think of it as a music game.

Each key is required to support analog input for the sound sources .

Keyboard expression is the ability of a keyboard musical instrument to respond to change tone or other qualities of the sound in response to velocity, pressure or other variations in how the performer depresses the keys of the musical keyboard. Expression types include:

Velo...

chilly oar
#

Someone needs to create a project to use the analog signal of a Wooting and convert it to a common MIDI command, if you want to use the Wooting for music programs.

old reef
#

@chilly oar free piano is an opensource software that can let you play pinao or other musical instruments with your computer keyboard.
we just need to know the speed of the key-press :

The piano, being velocity-sensitive, responds to the speed of the key-press in how fast the hammers strike the strings, which in turn changes the tone and volume of the sound. Several piano predecessors, such as the harpsichord, were not velocity-sensitive like the piano. Some confuse pressure-sensitive with velocity-sensitive. To avoid this confusion, pressure sensitivity is often, perhaps usually, called aftertouch. The MIDI standard supports both velocity and aftertouch.

In general, only high-end electronic keyboards implement true pressure sensitivity, while most professional-quality electronic keyboards support velocity sensitivity. Most inexpensive electronic keyboards, such as toy electronic keyboards and basic learning keyboards manufactured by Casio and Yamaha in the US$100 price range, do not have velocity sensitivity, but instead a manually-adjusted note volume.

chilly oar
#

@old reef I can't do anything with this information and I don't even care. I don't thing the analog values from a W1 and W2 is good enough to use it for this kind of purpose. It would be just a gimmik but without any real world value I guess. The analog range is only from 1.5 up to 3.6 mm, which isn't optimal for it. Maybe it's different with the Lekker edition.

With a precise analog value together with the time it should be possible to emulate both velocity and aftertouch. But I guess to create a good emulation your knowlegde of coding and music making must be good. So I think it's unlikely that Wooting will come up with a MIDI support anytime soon nor a community member.

old reef
ashen dune
#

Is there a way I can custom the wooting firmware or change the register values etc?

#

take things out I don't need or add things I want

#

I mean is wooting f/w open source or proprietary atm?

#

Shame. I Would be very interested to learn to program firmware and pull out things I dont need and try to optimize it for latency

wide nymph
placid ledge
#

https://github.com/WootingKb/wooting-analog-sdk/releases/tag/v0.1.0
https://github.com/WootingKb/wooting-analog-plugin/releases/tag/v0.1.0
There are now installers for the new Analog SDK and required Wooting plugin if you want to get stuck in!
To get started, install both the SDK & Plugin and get the SDK tar for your platform and use the wrapper library & headers included to start developing with the Analog SDK!

#

The APIs aren't final, so don't be surprised if breaking changes are made before the full v1.0.0 release. However, I don't see the API changing drastically atm unless we get some feedback that require some breaking changes

#

If you care about the design & future of the Analog SDK, this is the best time to get stuck in as we're currently in a position where big changes can be made. Once v1.0.0 comes out, it'll be harder to make substantial design or API changes

#

I'm here to help out or answer any questions,

blissful willow
#

ohai, can I get beta access to the wootility so I can get the latest firmware?

fathom garnet
blissful willow
#

Thanks

#

Beta firmware seems like it is much faster. Is the inclusion of 2 bytes per key code an indicator of future products? ^^

fathom garnet
blissful willow
#

The analog protocol coming from the newest firmware uses two bytes per keycode instead of the old single byte, indicating there might be more than 256 keys or analog input sources. Will the Lekker have that many?

#

@meager seal I'm writing an SDK in C.

#

The rust interop doesn't work for my project, violates some guarantees that need to be met.

#

So I'm writing an HID wrapper myself.

fathom garnet
#

I mean given that you have a longer range with the lekker switch I don't know how else you'd cover that aside from increasing the ammount of data transfered

blissful willow
#

What do you mean longer range?

fathom garnet
blissful willow
#

The lekker switches will have a cleaner signal but it looks like they still only report 8 bits worth of analog information.

fathom garnet
#

well the lekker switch starts earlier than the flaretech switch, which starts at 1.4 mm (or 1.5 or so idk)

#

where the lekker switch can start at 0.1mm

blissful willow
#

Yeah that's very neat

#

However still not addressing the 2 bytes 😅

#

two bytes per key code, one byte for the analog value

#

which is the same as the old firmware but means that Wooting suspects there will be more than 256 different key codes potentially.

fathom garnet
#

@hybrid lake probably best to just ask him directly before we speculate as I obviously also dont know for sure

blissful willow
#

Does the lekker have that many keys? o-o

#

v strange. would be really cool if they were pulling a fast one and were just reserving the byte for a higher accuracy with the lekker switches. If you got 16 bits of analog information that'd be really impressive.

fathom garnet
#

would already help with small thing like not needing a perfect button press to gain 100% value but still maintain a nice curve etc.

blissful willow
#

For other uses of a keyboard it would make a lot of sense. For gaming, you're probably right.

placid ledge
#

It's 2 bytes because the first 255 values are for HID USB key codes, anything above it is for keycodes for keys not defined in the spec, like fn key, mode key, etc

blissful willow
#

How were they handled before then @placid ledge? I noticed the codes changed entirely, too (e.g. ESC was 0 in the older firmware)

#

Were those proprietary?

placid ledge
#

Before It was using a scan code enum which had no relevance to anything else

blissful willow
#

You're right, HID codes are being used now. Neat ^^

#

Thanks @placid ledge

placid ledge
#

@blissful willow What are the guarantees that the sdk doesn't have which you need?

blissful willow
#

@placid ledge No disk access - the plugin system isn't necessary for this project and we don't want to support it.

placid ledge
#

I'm curious what this project is where this is the case

blissful willow
#

Mainly just want direct access without loading arbitrary binaries as it would be a vector for malware or hacks.

#

Right now, the SDK blindly dlopen()'s any so/dylib in the given folder, which we view as a security concern.

placid ledge
#

Well, it doesn't necessarily need to remain like that

blissful willow
#

Sure, of course

#

However we tried to shim the rust build into our own build system and cargo was causing issues (as cargo does..) so we decided to wrap the libusb fork of hidapi and pull the analog values ourselves 🙂

#

Since it appears the latest version of rust's hidapi uses an older fork, too.

placid ledge
#

I think they may have updated the hidapi-rs to use the libusb fork

#

Hmm, maybe not actually, just checked and must've been the issue that was opened about it that gave me that impression

#

Don't think it has been done yet

blissful willow
#

Yeah :/

fathom garnet
#

now I am curious as to what you are making, since it doesn't seem to be a small personal thing if you care about attack vectors

blissful willow
#

MMO 🙂

#

People should always worry about attack vectors 😉

fathom garnet
#

..are you by any chance developing that with one other dev and are currently not finding artists for the project?

blissful willow
#

I have another dev (kind of) but we don't need artists, no.

fathom garnet
#

you dont need any or you couldnt find any? because I know someone who is(was) making an mmo with someone else and couldn't find artists for the project lmao

blissful willow
#

Don't need them haha - probably wasn't me ^^

fathom garnet
#

okay just wondering because that would've been funny rooXD

blissful willow
#

Every dev is always looking for artists 🙄 bane of development.

placid ledge
#

2 things:
With the attack vector stuff, that is a fairly genuine concern and implies a problem that needs fixed in the sdk
You shouldn't have needed to shim the rust build into yours, all you need to use is the prebuilt wrapper dll

#

You're not going to be the only one who has that concern, so it's something that will need to be dealt with in the sdk

#

@blissful willow

blissful willow
#

Yeah, especially since there's no standard place to install them and right now it appears that a user-accessible directory is the default, which means little chance of blocking a user-land script from dropping a .so file into a directory under ~

placid ledge
#

Do you think having the SDK & plugins being installed in Program Files (on Windows) for example, would help? And making sure plugins are only loaded from root/admin paths?

blissful willow
#

The latter is more important.

#

I don't remember if on windows whether or not Program Files is locked down or requires admin privileges.

#

But e.g. VSTs for audio development have a specified place where they are located

#

Yep, looks like it: C:\Program Files\VSTPlugins is the standard VST directory where plugins are installed.

#

Would make sense to put them in C:\Program Files\AnalogInputPlugins on Windows, /Library/AnalogInputPlugins on MacOS and there can be a number of places where they live on Linux, depending on the system. Most likely somewhere under /usr/local/share

#

With potentially the exception of Windows, the other two require admin privileges in most cases - especially for end users.

placid ledge
#

Yeah, that sounds like a good idea

#

I'll sort that out tomorrow

#

If that's sorted would you use the SDK?

blissful willow
#

I'd reconsider it. Still makes things hard to build. We pin submodules with git and like to build ourselves to prevent surprises. Not critical but it'd be one more thing to integrate cargo.

placid ledge
#

With the architecture of the SDK all you need is the wrapper, which should be updated manually. I don't think you need to do a submodule

#

for this particular case

blissful willow
#

The wrapper is still a static lib that needs to be built though. Unfortunately cross platform builds aren't really possible and we don't like keeping binary assets checked in.

placid ledge
#

Hmmmm, okay. If you try getting it building, make sure you only build the wrapper rather than the entire thing

#

Let me know if you need any help or if you have any further thoughts, as I am making the SDK for devs like you, so would like to make it as good as possible

placid ledge
#

@blissful willow In the dev branch I've made it only load from sub directories of Program Files\WootingAnalogPlugins, /usr/local/share/WootingAnalogPlugins and /Library/WootingAnalogPlugins

prisma night
#

When to expect an SDK update for the Wooting two?
I tried to changed the productid in the sdk to the wooting two pid, but had no success. wooting_rgb_kbd_connected still returns 0. There seems to be more low level changes I have no idea about

placid ledge
prisma night
#

oh thanks, I totally overlooked that pr

upbeat citrus
#

Dear Devs, can anyone look into this issue:

chilly oar
#

@upbeat citrus I don't think it's an Aurora problem at all. Wooting can't even help you with that, because Aurora has nothing to do with Wooting, so they can't gave support for it officially.

If you really mean shutdown and not a standby or suspend it's because that the Wooting missed the sleep command and your BIOS is set to still provide Power on USB after a shutdown.

upbeat citrus
#

I'll try that

strong siren
#

@upbeat citrus it's definitely an issue with aurora as I said in the gh issue. If I stop the wooting integration manually the lights turn off fine

#

It happens becaus Aurora doesn't close the hid connection properly before shutting down

#

On other devices it's not really a problem because most of them have the manufacturer's software making the actual connection and aurora just connects to that

chilly oar
#

But he must still has enable the USB power, because otherwise the mainboard would just unnpower everything included the Wooting.

upbeat citrus
#

After a quick glance on my BIOS, no option for Power on USB to be found.

chilly oar
#

Normally the mainboard should power off the whole system.

#

So if your system don't power off everything it's an option in the BIOS and I don't think this option is missing on your BIOS.

strong siren
#

I didn't realize the bios was supposed to power off everything. I'll see if mine has that

chilly oar
#

It's an option to still provide power to USB device even when the PC is fully off.

#

Like Deep Power Off. Maybe is something like a Win quick start (standby mode, energy saving mode) so the PC isn't even turned off.

#

Maybe he needs to update the BIOS.

#

But either way, in some way or another the OS should tell the devices that Windows is shutting down, so the devices can enter sleep mode. I know there are still some problem related to the sleep mode with the Wooting which aren't fully fixed.

gleaming cove
#

Hey all, looking to use Lekker switches for a project. Was there ever any published documentation on the hardware implementation of the Lekker switch?

#

I know they're like not out yet but still

#

Thanks

icy needle
quiet root
#

did u run npm install

icy needle
#

it returns an error, i am looking at it

quiet root
#

give the error

icy needle
#

this : gyp ERR! build error
gyp ERR! stack Error: C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild.exe failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:262:23)
gyp ERR! stack at ChildProcess.emit (events.js:198:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12)
gyp ERR! System Windows_NT 10.0.18362
gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\M8\Documents\Wooting_ReadValue\wooting-analog-example\node_modules\ffi
gyp ERR! node -v v10.16.3
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
npm WARN wooting-analog-example@1.0.0 No repository field.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! ffi@2.2.0 install: node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the ffi@2.2.0 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\M8\AppData\Roaming\npm-cache_logs\2019-10-03T21_18_14_123Z-debug.log

quiet root
#
npm install --global windows-build-tools
#

and then npm install again

icy needle
#

seems to be workiong fine up till now...

#

well see

quiet root
#

u need build tools so ffi can install

#

since its build on runtime by node-gyp

icy needle
#

ok

#

didn't work

#

same error messsage as before it seems

quiet root
#

send the entire error log

icy needle
#

yes

#

1moment

#

pasting trhe file to not drown the text channel into unnecesairy stuff

#

im not great at typing

quiet root
#

do you have python 2.7 installed?

icy needle
#

yes, just did

#

2.7.16

quiet root
#

if u run python -v in console

#

its also 2.7.16?

icy needle
#

yes

#

just that one

#

python -v doesn't return anything

quiet root
#

then python is not in path

icy needle
#

f

quiet root
#

add it to ur path variable

icy needle
#

how

#

im not very good at this

quiet root
#

where did u install python to

icy needle
#

standard location

quiet root
#

press winkey and start typing

#

to search this

#

and then open it

icy needle
#

this is startiong to go hacker-like lmao

icy needle
#

as i have my windows in french i can't find the first one

quiet root
#

@icy needle then right click ur "this pc" icon on the desktop

icy needle
#

nevermind found it

quiet root
#

after that hit ok

#

and close the window

#

reopen the cmd

#

and run python -v again

icy needle
#

just returns an empty line

quiet root
#

did u edit it yet

icy needle
#

yes

#

is it python27 or python 2.7

quiet root
#

just as i typed it

#

i mean check ur c drive

green solstice
#

hey folks, can anyone tell me if keystrokes are sent on actuation or release on the wooting keyboard? i'm trying to do some input latency testing (software side) using my wooting one

#

i don't see the RGB effect occur until key release, would like to know if RGB lights up at the same time input is sent from keyboard to PC, so that i can use that as a marker for when input is sent

quiet root
#

wha

green solstice
#

i'm trying to use the wooting keyboard to determine software side input latency

#

we have a 1000fps camera to measure from RGB activation to when action occurs on screen

#

but i'm not sure if input is sent from the keyboard on key press or key release

icy needle
#

"we have a 1000fps" -whoa

green solstice
#

the RGB effect doesn't appear to pop until key release, but i don't know if that's the moment the input is being sent by the keyboard

#

(it's actually just a Sony Cybershot mk.IV, it has a 1000fps capture mode for ~2s captures

fathom garnet
#

you can use DKS to get the input when you want, so you could have it be either way

quiet root
#

the input is sent on key down

#

^

#

standard digital is key down

#

and key up

#

cause windows has both events

#

its software dependant on if they react on key down or key up

gleaming cove
#

Without knowing anything about Wooting's special sauce, standard HID should just send the state. There's no "Key down" or "key up"; just when the key is polled "What state is the key currently at?"

green solstice
#

well that'll be fun trying to figure out who here in my office knows which we use, haha

quiet root
#

yes so key down is when its pressed which it is once it passes actuation point

#

and its released when it passed it again from the otherside (going up)

gleaming cove
#

Once it passes the actuation point and gets polled again

quiet root
#

the rest is win specific and fires both at key down and key up

green solstice
#

gotcha, the RGB effect appears to be tied specifically to the key release from what i'm seeing?

quiet root
#

thats controlled by the mcu onboard

icy needle
#

@quiet root im stupid because i did not place everythin in the same folder

gleaming cove
#

It could also just be delay

quiet root
#

so idk how exactly they work

#

@icy needle what i showed u is standard location

gleaming cove
#

A good test is to just hold the key down instead of tapping it

quiet root
#

^

icy needle
#

ok

green solstice
#

good call @gleaming cove

#

i'll have to poke at that, but that should at least answer that question for me

quiet root
#

if u really want to test input latency id advise using tachyon mode Kappa

icy needle
#

sends me keyboard not connected now

quiet root
#

w2?

icy needle
#

idk what that mewans

quiet root
#

wooting 2

icy needle
#

yes

quiet root
#

ya need a fixed sdk

icy needle
#

yesysesyes

quiet root
#

i think the example wasnt updated to the new wooting sdk yet

#

as in the rewritten one

icy needle
#

oh

#

so how do i do it ?

quiet root
#

¯_(ツ)_/¯

#

havent touched on the new sdk yet

sage igloo
#

I'd recommend to sacrifice a spare switch and solder an LED to it for accurate measurement

green solstice
#

@quiet root not sure how i could use Tachyon for this specifically, as we're using the RGB to key our counting forward from activation (hard to discern the exact ms actuation occurs otherwise)

icy needle
#

lmao thanks for the help btw man, really appreciate it 👌 👍

green solstice
#

it looks like it'd be a more accurate measurement, but harder to actually measure in practical terms with no RGB effect to queue from for our "start"

icy needle
#

goodnight everybody

green solstice
#

@sage igloo we've considered that, but i'm hoping i don't have to do that to my wooting (i love this keyboard)

quiet root
#

the rgb effects dont tell u the input latency tho cause they literally happen even without a pc attached

#

i think they even made a piece on latency

#

and what goes into it

green solstice
#

oh they did, i've read it a few times now 🙂

quiet root
#

ya

sage igloo
#

Don't you get like 4 spare switches?

green solstice
#

the RGB just gives me a visual marker to begin counting ms between input and on-screen change

quiet root
#

u do get them xeanoa

#

def didnt fuck that name up

#

@icy needle i might PR a change to use the new sdk

gleaming cove
#

Oh yeah don't use RGB as a visual marker lmao

#

Realistically, the least latent you can get is a single LED inline with the switch electrically

icy needle
#

idk wehat PR means

gleaming cove
#

Pull Request

green solstice
#

may have to do that, we've already got a 1ms polling rate mouse we've done that with

quiet root
#

pull request as in make the example work and then ask if they adopt my change into the github repo

icy needle
#

ok thanks

#

oh ok

quiet root
#

might i ask what u wanna do cause it seems you are not experienced with this at all

fathom garnet
#

just make a setup similar to what people use to show mouse latency, with a single led over the screen as a point for activation time

icy needle
#

no i am definetly not

quiet root
#

then i would advise to actually learn nodejs and git before doing this

icy needle
#

ohohh

quiet root
#

its not the wisest to start full blown with some sdk thats pulled from git and uses like other external deps

#

start small and work your way up

icy needle
#

so my goal is just to have a qtcreator window that shows the value of the keys

#

and i dunno where im going

green solstice
#

yeah, i will probably have to do that @fathom garnet, we were excited just to find a 1ms polling rate keyboard to do comparison against, was hoping i could lean on the RGB w/ the wooting keyboard

quiet root
#

why qtcreator tho

icy needle
#

we use it in class

#

im in second year electronics specialist formation

#

im 17

gleaming cove
#

@green solstice Rule of thumb is to not use RGB as a marker. There can be latency between interpreting a keystroke and outputting the right color on the LED

#

It could be inherent in the communication protocol like with WS2812 or just how the firmware is architected since you generally don't want your eye candy running prioritized over input latency

green solstice
#

yeah, i'll have to grab our dev who dabbles in mechanical keyboard making on the side and have him rig something up on my wooting

icy needle
#

i mean i'd use VS if that's a requierment

quiet root
#

i think the most accurate way to get latency is to interecpt the usb packets and then count from there

gleaming cove
#

That's not end to end though

quiet root
#

@icy needle you know that qtcreator plugins are written in c++ right?

gleaming cove
#

End to end begins at the keystroke and ends at the screen, which is what slipper is looking for iirc

quiet root
#

well thatll be hard tho

gleaming cove
#

It's very doable

icy needle
#

@quiet root Absolutely not

green solstice
#

it's not very hard if i know the point at which my keypress is sent as input

icy needle
#

is it a problem ?

quiet root
#

qtcreator has a built in way to create plugins for it (which is what you want)

#

but you cant use nodejs for it

green solstice
#

it's the entire reason we've got a 1000fps capture, we can decode it into screenshots which each represent 1ms in time, and we have known values for the display latency of the displays we're using

#

and since lovely folks have done the benchmarking for the hardware input latency on the wooting, that's a known value as well

gleaming cove
#

You generally want a higher speed camera than your polling rate

icy needle
#

what's the simpliest way to make a preogramm which shows values coming from the keyboard ?

green solstice
#

so our primary issue is identifying the moment teh input occurs

#

yeah, 1:1 is the best we're going to do for now, i don'thave the budgets to get truly high speed cameras on this team, at least for now

gleaming cove
#

Yeah you need a higher speed for that

quiet root
#

@icy needle nodejs but it only runs on a pc with nodejs and the other requisits to compile ffi etc

gleaming cove
#

Ah gotcha

quiet root
#

with the new sdk im not sure if @placid ledge made examples for it

#

cause best bet is just a VS solution that compiles to exe

icy needle
#

isn't there a dll for it tho ?

quiet root
#

nodejs cant use dlls. it compiles them to have node hooks which then can be used

#

but thats what ffi is for

#

like this weird bridge

#

between 2 worlds

icy needle
#

so i'd have to build the dll myself ?

#

from the nodejs files

green solstice
#

1000fps measurements will do for now, i can be accurate within a few ms if i'm accurately determining the input point, if we prove this testing out in terms of results it will be much easier to get the purse strings to open for a true high speed camera

#

(and franky a few ms is accurate enough, since we're really looking to determine the # of frames of delay here, so sub 16ms we at least have a range of 1 frame)

gleaming cove
#

Yeah for sure

quiet root
#

@icy needle i mean just check out the sdk itself

icy needle
#

man im so lost rn

#

i have to go to bed, it's midnight here and i have school tomorrow, thanks for the help, might come back tomorrow

slim gust
#

just realized that ffi doens't support nodejs 12.x, took me some hours ffs

quiet root
#

well there is a branch for node12

#

currently working on a node wrapper for the new analog sdk

#

already got most of it implemented just testing today

slim gust
#

building ffi failed for me because the example code requests ffi version 2.2.0 and for some reason only 2.3.0 works for me

quiet root
#

theres virtually no difference between 2.2.0 and 2.3.0

#

both dont support node12

slim gust
#

i've got no clue either why it is "working" now, still cant find the keyboard

quiet root
#

as mentioned old sdk

#

not supporting wooting 2 yet

#

will try finishing the rewrite today

slim gust
#

haven't been doing any programming for a while

#

a that might explain a lot, thx

quiet root
#

am working on the new sdk examples

slim gust
#

I'm ill rn so been doing some digging into using the sdk, as i#ve only gotten my kb this tuesday

icy needle
#

yoooo @quiet root

#

i found what i was searching for

#

i think

quiet root
#

u did?

#

nice to hear

icy needle
#

yeah, still figuring out how to use that dll tho

placid ledge
#

What are you struggling with?

icy needle
#

including the "wooting_analog_sdk.dll" file into qtcreator

placid ledge
#

Are you trying to use the old sdk?

icy needle
placid ledge
#

Not the old sdk which it looks like you're using

icy needle
#

oh ok

#

thanks