Page 1 of 1

Regular key press rate at continous pressure on keyboard key

Posted: Fri Feb 05, 2016 9:03 am
by extremraym
Hi everyone !

I was looking for a GlovePie alternative, since it seems to be abandoned and that it is completely unstable on my PC.

I just tested FreePie and I have to admit that wow, it is cool !

I am trying to map my WiiMotes to it,

I know there is a code snippet on the wiki for that,
but I have a problem.

I don't find function to press key at a regular rate.
It is always to fast, or it just add one single character at continuous pressure (like the wiki code snippet) instead of several, just like when we press a key on a regular keyboard.
The consequence is that I can't use these in games where sometimes a continuous pressure is required, because it either spam the key so hard that the game lag, or because it is just one tiny key pressure length.

How to have Regular key press rate at continous pressure on keyboard key?

Thanks for your advice !

Re: Regular key press rate at continous pressure on keyboard

Posted: Fri Feb 05, 2016 9:36 am
by konstantin_lozev

Code: Select all

keyboard.setKey(Key.C,wiimote[0].buttons.button_down(WiimoteButtons.Two))
does not work for you?

Re: Regular key press rate at continous pressure on keyboard

Posted: Fri Feb 05, 2016 10:34 am
by extremraym
@konstantin_lozev
Thanks for the help !
No it doesn't work either, it add a looooooot of C even with a short pressure.


@all

I just found these scripts: Freepie Wiimote-Nunchuk for Vjoy.

I think it is an even more elegant solutions that mapping the 4 wiimotes to all touch of the keyboard.
I didn't understand the pinciple behind Vjoy but it totally make sense now, it is great that FreePie can talk with it.

-----
Despite the fact I found a nicer solution for my particular thing, I'm still curious about how we could satisfy the original feature request. I'm pretty sure it can be useful if some circumstances (sending too many keyboard touch signal make certain apps crach).

Re: Regular key press rate at continous pressure on keyboard

Posted: Fri Feb 05, 2016 11:08 am
by konstantin_lozev
Strange

Code: Select all

vJoy[n+1].setButton(vjoy_button, wiimote[n].buttons.button_down(wiimote_button))
works for you but

Code: Select all

keyboard.setKey(Key.C,wiimote[0].buttons.button_down(WiimoteButtons.Two))
does not?
They are equivalent for FreePIE, AFAIK...

Re: Regular key press rate at continous pressure on keyboard

Posted: Sat Feb 06, 2016 9:50 am
by extremraym
Yep, I guess that vJoy as some internal ways to deal with such problems.

As long as the destinations software can recognize joystick input, it is all good. If not, then it is a problem. :?

Re: Regular key press rate at continous pressure on keyboard

Posted: Sun Feb 07, 2016 2:12 am
by FrenchyKiel
konstantin_lozev wrote:Strange

Code: Select all

keyboard.setKey(Key.C,wiimote[0].buttons.button_down(WiimoteButtons.Two))
does not?
They are equivalent for FreePIE, AFAIK...
not exactly same thing, each time you do setkeydown = setkey(key.c, true), there is an action of keypress, so its the reason lot of C are generated. For vjoy it is just a state and not an action press.

maybe this code is better

Code: Select all

winb = wiimote[0].buttons.button_down(WiimoteButtons.Two)
if winb != Keyboard.getKeydown(Key.C): 
    keyboard.setKey(Key.C, winb)

Re: Regular key press rate at continous pressure on keyboard

Posted: Mon Feb 08, 2016 1:31 am
by CyberVillain
If you guys come up with anything I can help you to integrate it with FreePIE. (If there is something wrong with how emulating keys works i mean).