FunKeyMonkey

Discussion in 'Pyra OS (Debian GNU/Linux)' started by bzar, Jul 8, 2015.

  1. comradekingu

    comradekingu Glowing ember

    Joined:
    Apr 15, 2011
    Messages:
    4,944
    Cut radius of circle of nub movement into a 1:1 square that fits the 16:9 sides for perfect alignment?

    At-least for desktop use that is interesting.
     
  2. bzar

    bzar A Commando

    Joined:
    Sep 22, 2008
    Messages:
    4,444
    Location:
    Finland
    Well, there needs to be someone sending the "mouse moved 3px to the right" events at constant intervals even when "nub moved" events are not coming. That someone is either the plugin being polled by funkeymonkey core or a separate thread. I can't set "velocity" to a relative input device. Only send "it moved" "it moved" "it moved" over and over again. What I want to avoid is having the funkeymonkey core poll the plugin just in case something needed to happen at intervals. "Hey, it's been some milliseconds, do you need to do anything? No? Cool."

    Yeah, thought about that. It's REALLY hard to hit stuff with a mouse like that. Also, not possible to right-click (using left nub) anywhere but center is a downside.
     
    ible likes this.
  3. comradekingu

    comradekingu Glowing ember

    Joined:
    Apr 15, 2011
    Messages:
    4,944
    If you limit the square to the clickable region, you could use the outside area for turning up and down something.

    Like having less or more brightness on screen or scrolling/panning by turning in big circles.

    Rather depends on sensitivity to resolution, but it could work. (Just thinking aloud)
     
    Last edited by a moderator: Nov 5, 2015
  4. bzar

    bzar A Commando

    Joined:
    Sep 22, 2008
    Messages:
    4,444
    Location:
    Finland
    Maybe it could. Not something I'll implement now though :)
     
    comradekingu likes this.
  5. _jr_

    _jr_ Advanced Member

    Joined:
    May 5, 2013
    Messages:
    1,170
    I'm wondering whether this 'keep mouse moving stuff' isn't some kind of key repeat.
     
  6. bzar

    bzar A Commando

    Joined:
    Sep 22, 2008
    Messages:
    4,444
    Location:
    Finland
    There's no mechanism for telling to uinput "repeat this" as far as I know. Also key repeats seldom happen 60 times per second :p

    But yeah, I guess it could be thought of as such.
     
  7. _jr_

    _jr_ Advanced Member

    Joined:
    May 5, 2013
    Messages:
    1,170
    Not criticizing, just wanting to understand whether the same mechanism could be reused for autofire or something.
     
  8. bzar

    bzar A Commando

    Joined:
    Sep 22, 2008
    Messages:
    4,444
    Location:
    Finland
    Well, making a plugin for autofire is quite simple. Or adding that to this one for that matter. For now I'm implementing what pandora has, but if more configurability is desired I'd probably go for some more generic way of adding timed repeating actions than the current mouse interpolator thread.
     
    _jr_ likes this.
  9. _jr_

    _jr_ Advanced Member

    Joined:
    May 5, 2013
    Messages:
    1,170
    Yes, not a priority, but having support for timed events probably has some applications.
     
  10. ible

    ible professional vim user

    Joined:
    Mar 24, 2014
    Messages:
    2,144
    Location:
    Seattle, WA
    the great thing about funkeymonkey is that you can code these features yourself given some of the very nice examples ;)
     
  11. bzar

    bzar A Commando

    Joined:
    Sep 22, 2008
    Messages:
    4,444
    Location:
    Finland
    Tried reloading configuration using inotify yesterday, and it's a bit messier than I'd hoped. Since it's actually watching an inode (inode notify) it works fine when a file is modified in-place, but some editors (like vim) tend to write to a temporary file, remove the original and rename the temporary file to its place on save. When this happens inotify loses the inode it was watching and the configuration no longer reloads. I could define the plugin to require a configuration directory instead, watch the directory to catch files popping in and out of it, but I'd also need to watch all the relevant files in case they're modified in-place. To put it short, doing all this would be the majority of the plugin's current line count :D.

    I think I'll try registering a dbus service with a "reload" method instead.
     
  12. slaeshjag

    slaeshjag ¯\_(ツ)_/¯

    Joined:
    Apr 8, 2010
    Messages:
    2,687
    Location:
    ~Stockholm, Sweden
    Protip: If you go for a service on the system bus (which you should,) don't forget to create a rule in /etc/dbis-1/system.d, or you won't have permission to claim a name.
     
  13. bzar

    bzar A Commando

    Joined:
    Sep 22, 2008
    Messages:
    4,444
    Location:
    Finland
    :mellow: Why does every solution involve complications?

    Thanks for the preemptive pointer though :)
     
  14. slaeshjag

    slaeshjag ¯\_(ツ)_/¯

    Joined:
    Apr 8, 2010
    Messages:
    2,687
    Location:
    ~Stockholm, Sweden
    Lets just say that my first steps into dbus with dbpd was rough :p
     
  15. notaz

    notaz Certified Guru

    Joined:
    Aug 23, 2005
    Messages:
    4,911
    Location:
    Lithuania
    Do we really have to do this? I'd prefer to avoid these kind of dependencies, these things tend to change and likely break on OS updates, make it hard to debug if some user has a problem and is generally PITA if you don't know dbus inside out.
     
    _jr_ likes this.
  16. slaeshjag

    slaeshjag ¯\_(ツ)_/¯

    Joined:
    Apr 8, 2010
    Messages:
    2,687
    Location:
    ~Stockholm, Sweden
    The dbus system bus has a deny-all policy by default when it comes to owning names. Apart from changing the default, I am not aware of how to avoid the issue apart from adding rules.

    This is a relatively recent change, probably happened in the last 5 years.
     
    Last edited by a moderator: Nov 7, 2015
  17. bzar

    bzar A Commando

    Joined:
    Sep 22, 2008
    Messages:
    4,444
    Location:
    Finland
    I took the easy way out for now. Added SIGUSR1/2 handling support to FunKeyMonkey and made SIGUSR1 reload configuration for modalgamepad :p
     
  18. bzar

    bzar A Commando

    Joined:
    Sep 22, 2008
    Messages:
    4,444
    Location:
    Finland
    Okay so modalgamepad now has the following features:

    • Nub axis modes: left/right joystick x/y, mouse x/y velocity, scoll wheel x/y direction (since setting scroll speed isn't that simple I decided against making it scroll velocity)
    • Nub click modes: left/right nub click, left/right mouse button
    • Mouse/wheel deadzones
    • Mouse sensitivity
    • Load nub axis/click modes, deadzones and sensitivity from a file given as command line parameter (defaults to passthrough configuration), reload config file on SIGUSR1
    Anything important missing for an MVP?
     
    levi, _jr_ and comradekingu like this.
  19. Neelix

    Neelix Insecticidal Maniac

    Joined:
    Jan 8, 2011
    Messages:
    3,217
    Location:
    Melbourne, Australia
    I don't think that it's needed for a MVP,  but I think it would be nice to have a joystick mode where both nubs and the gaming buttons all presented as a single joystick device.  


    This would be especially handy for old dos games which let you control a game with either a joystick or the keyboard but not both at the same time.


    -Neelix
     
  20. bzar

    bzar A Commando

    Joined:
    Sep 22, 2008
    Messages:
    4,444
    Location:
    Finland
    That's actually how it works right now :p


    Modalgamepad plugin at this time creates a gamepad and a mouse. I'll probably have to still tune it for the actual evdev input devices Pyra presents when there's information what those are. Because of the specifics the current plugin isn't by any means a drop-in solution, but it's an easily customized one.


    Is the pyra a limited keyboard and a full game pad? An overlapping keyboard+gamepad? Two one-nub devices, and overlapping gamebuttons and keyboard devices? A full(ish) keyboard and a two-nub joystick? Personally, I'd perhaps lean to either the first or last of those options. Overlapping devices should maybe be something for the userspace, not generated by drivers, though there are valid points to the contrary as well.
     
    Neelix likes this.

Share This Page

Loading...