Menu

#2638 mice.xml: invalid <mod-up>

None
New
nobody
None
Low
2021-09-06
2021-08-20
No

When the mouse wheel scrolling stops, mod-up is never executed until before the main binding when it is scrolled again. The problem happens separately for the two corresponding "buttons".

Reproduction.

  1. Insert the following under <input> of ufo-set.xml
<mice>
 <mouse n="0">
  <mode n="1">

   <button n="3">
    <binding>
     <command>nasal</command>
     <script>
      print("+ 1");
     </script>
    </binding>
    <mod-up>
     <binding>
      <command>nasal</command>
      <script>
       print("+ 0");
      </script>
     </binding>
    </mod-up>
   </button>

   <button n="4">
    <binding>
     <command>nasal</command>
     <script>
      print("- 1");
     </script>
    </binding>
    <mod-up>
     <binding>
      <command>nasal</command>
      <script>
       print("- 0");
      </script>
     </binding>
    </mod-up>
   </button>

  </mode>
 </mouse>
</mice>
  1. Run FG with UFO.
    Expected: + 1 and + 0 printed when wheel is rolled up and stopped, and the same with - when rolled down and stopped.
    Have: The first time around (for each direction separately) a + 1 or - 1 as expected, but there is never a 0. All subsequent scrolls will have 0 before the new 1.

Discussion

  • James Turner

    James Turner - 2021-08-21

    This makes sense becuase there is no release event for wheel events. I.e it's not really a button. We could fake the mod-up with a timeout of maybe 500 msec? (or similar....) but I think that's the best which is possible.

     
  • Anonymous

    Anonymous - 2021-08-21

    Indeed, I didn't think of that!

    Yes, imho it would make sense to make something that

    1. runs mod-up after a timeout
    2. is suppressed if there's subsequent scroll (separately per direction, of course) -- so that things which rely on this mechanism can know that the scrolling is "continuous" instead of "bursts"
     
  • James Turner

    James Turner - 2021-08-23

    Can you send an email to the developer list propsiing this and see if anyone had feedback? Especially on if making this change would negatively impact anything? (I can't imagine how, but...)

     
  • Anonymous

    Anonymous - 2021-08-31
    • summary: mice.xml mouse wheel corruption --> mice.xml: invalid <mod-up>
     
  • Anonymous

    Anonymous - 2021-09-06

    It seems that have been no replies on the ML. I think it would be ok to change the behaviour.

     
  • James Turner

    James Turner - 2021-09-06

    Agreed, do you want to propose a patch?

     
  • Anonymous

    Anonymous - 2021-09-06

    It looks like this one is beyond my skills. I can try but can't promise anything.

     
  • James Turner

    James Turner - 2021-09-06

    That's okay, I can do it, just quite busy so takes some time.

     
  • Anonymous

    Anonymous - 2021-09-06

    I believe the place to insert it would be flightgear/src/Input/FGMouseInput.cxx?

     
  • Anonymous

    Anonymous - 2021-09-06

    No problem, take your time ^^

     

Log in to post a comment.

MongoDB Logo MongoDB