#Faux analog mode

1 messages · Page 1 of 1 (latest)

wide dagger
#

Hello. It would be an incredible addition to add a "Faux analog mode". As the name implies, it's not really analog but it would approximate toward it.

The core concept is the same as fan control speed, which uses Pulse Width Modulation (PWM).
Fan speed is not controlled by limiting current and/or voltage (because how electric motors work in general. Reducing the voltage and/or current would decrease speed but also would decrease the torque. That is not an ideal solution and PWM is proven superior).

Instead, the controller evenly (in between pulse cycles) supplies and cuts power to the current over a period of time.

Lowering the duty cycle (ON time during each cycle) will result on lower average power over a time period. This would, in theory (and in practice as shown with case fans), allow you to have, in average, control in between 0% and 100%.

A layman example would be in a racing game or a flight simulator (or a stealth game for all I know) where you want to change your direction in increments smaller than what your current (digital) control allows. What would a human do? Give out multiple short keypresses. This, in turn, would bring the average action input to a value lower than 100% as shown in the graph (The example is for an inductor. V is for input, B would be the inductor output).

On the given graph the voltage applied is constant (Let's assume 0V is not pressed and 1V is pressed) during the duty cycle. As you can see, by changing the duty cycle (ON time) you can modulate the output over time to (approximately) whatever you want.

The polling rate of the keyboard should be plenty enough to have a somewhat "smooth" experience while modulating outputs. If you want to get roughly 50% of throttle in Grand Theft Auto, you send out 500 presses and 500 releases with a 50% duty cycle(W key). The key presses would correspond to the start of each duty cycle and the releases to the end of each duty cycle.

https://en.wikipedia.org/wiki/Pulse-width_modulation

Pulse-width modulation (PWM), also known as pulse-duration modulation (PDM) or pulse-length modulation (PLM), is any method of representing a signal as a rectangular wave with a varying duty cycle (and for some methods also a varying period).
PWM is useful for controlling the average power or amplitude delivered by an electrical signal. The aver...

#

Realized that the attachment is redundant since wikipedia embeds include images

wide dagger
#

FYI there shouldn't be any jittery movement due to the modelation unless somehow any input has ZERO dampening in game (which games with binary input only would be unplayable due to the lack of control given by the dampening). I was able to do something similar (to what I have described) in various games with no controller support with my finger (whose duty cycles are at a hilariously low frequency compared to what the keyboard would be able to run the modulation at) on many games and I am fairly confident this would practically close the analog gap in games that outright do not support gamepads.

If a human finger can rougly do the same the keyboard could do too. This would be a killer feature to add.

lament ore
#

You are aware that you can read out the analog values of each key regardless of the profile with the wooting-analog-sdk / wooting_analog_plugin.dll. And then you can use that data to feed it into a serial connection to an e.g. Arduino, Esp32, or similar, which then controls the fan. Or whatever you like.

wide dagger
#

not controlling fans my guy

#

just selectively pressing and releasing keys in select intervals over a second to simulate throttle on a game with only binary input

#

the example with controlling fans is because said method is used to controlling pc fans. However, it's not limited to fans. Many things use PWM because a rough square wave approximation to the curve is good enough (and PWM is solid state, etc.)

#

Other times PWM is the only way to get a pseudo analog signal from digital square waves

#

the reason it works is because the pulses are so short that the average output over a certain period of time will be lower

#

everyone does it in racing games with kbm with their finger

lament ore
#

Ah, sorry, I misunderstood. Interesting idea. I think reading the data from the analog SDK and send them to the game is a way to go, autohotkey, maybe.

wide dagger
#

yeah ideally you would read from SDK

#

but not all games are created the same and some don't even have controller support

lament ore
#

(you really want that active when a certain program is the active window or it'll fuck your typing)

wide dagger
#

oh yes i fucked with autohotkey a bit

#

i actually got a working antiaim with just autohotkey

#

i don't even know how because all it did was move my mouse

#

but yeah this is a feature a lot of people would thank for

#

myself included when i get a wooting keyboard

#

it's a bit sad i am not an autohotkey fan though

#

this feature is more important than it sounds like

lament ore
#

TBH I know reading the analog value with the dll is possible, but I still have to learn how.

wide dagger
#

I don't think there's autohotkey in linux

#

plus i would have to make a driver and stuff

lament ore
#

Oh, welp, Linux, I can install and use it … if somebody walked the extra mile. In the … 90s … I guess … I had Linux and it took me 3 weeks to get the printer driver to work (you had to compile it yourself on your machine … well, that was all the driver was done so far, it was just compiling it).

wide dagger
#

i mean writing a virtual keyboard driver from scratch

#

and the problem would be intercepting the keyboard input

#

and also the fact that it would spam the key

#

so typing would be very uncomfortable

wide dagger
#

bump

sacred sail
#

looks shite in some games depending on how walking/driving animations and sound effects are handled

#

the main issue is that not all games will just handle 1000 inputs a second

sacred sail
#

like ages ago

#

id have to lie about a direct message link but if you search for it you can prob find it

wide dagger
#

but it does work?

sacred sail
#

should work yeah

#

although it might need updating to the new analog sdk if theres any changes

wide dagger
#

no i mean like the core concept

#

even if the character looks like he's having a seizure

sacred sail
#

as mentioned if the game can handle the input speed when fully pressed yes

#

ideally youd modify the length the key is seen as held instead of spamming it

wide dagger
#

yea but you spam at variable lengths for evening purposes

sacred sail
#

but in general those tools work and people used em a bunch 4 - 5 years ago but then they faded into obscurity

#

same with setting system volume using the analog functionality

wide dagger
#

yeah but like

#

was the modulation actually effective even if it looked like the character had a seizure

sacred sail
#

as i said yes

#

those tools work

wide dagger
#

and it closes the gap in getting analog controls in games with none at all, right?

sacred sail
#

i personally didnt like the usage and rather used native analog profiles or a controller

wide dagger
#

i mean yeah preferably I would not do PWM but there's always these bunch of games that just have no analog controls at all

lament ore
sacred sail
#

thats true but it should be fairly easy to inject key presses into the OS event loop

wide dagger
#

yes but in my case i do not have AHK support and the best idea i got is faking a keyboard driver and stuff

sacred sail
#

even with c its trivial

#

ahk also just injects keypresses into the eventloop of windows

#

no custom drivers or such

wide dagger
#

and how would i go on about making it cross-platform on a single codebase

sacred sail
#

compiler macros to selectively include abstracted functions for each OS

#

heres a cross platform tool written in c that does the same

#

ofc you could also try implementing it in rust and then you dont have to worry about cross os much

wide dagger
#

I have no problem in using C because it usually is rewarding to keep it simple

#

it just looks daunting to do it

sacred sail
#

but yeah main issue will just be researching the best and most compatible way to do this as some games detect those false inputs from raw inputs

#

and ofc testing it cross platform

#

especially macos testing is notoriously hard cause most VM images work bad to not at all

wide dagger
#

yeah the problem with this is that if it were on the wooting FW you would not have to deal with actually disabling the real input with a profile or something

sacred sail
#

again you can also just eat key inputs like macro tools also offer

#

if we do consider this it would be very low priority for a FW dev to implement

wide dagger
#

better have it on low priority than just "you're on your own lmao"

sacred sail
#

usually we recommend software solutions for such timing intensive tasks as it can lead to scanrate instability meaning keystrokes might not get registered in time for the next poll despite being in the right state to qualify

wide dagger
#

oh well

sacred sail
#

its basically why theres not more complex RGB effects or extensive macro stuff on the keyboard

hybrid dagger
# sacred sail usually we recommend software solutions for such timing intensive tasks as it ca...

It would be really nice to have this. Even if the PWM frequency was lower to ensure no polling issues. Maybe allow that to be adjustable with an upper limit depending on the specific board's polling rate.

I kind of wish Wootility and the FW was open source so community contributions could be accepted. But I guess you have to keep market share from slipping away to clones.

In any case, consider this another upvote for PWM-style analog emulation.