Board index FlightGear Support Hardware

Maximizing Trackball Buttons

Joysticks, pedals, monitors.

Re: Maximizing Trackball Buttons

Postby innactpro » Sat Jun 03, 2023 12:20 am

Sorry that my level of code knowledge is enough only to make me dangerous and in no way useful.

Specific to mice.xml, it just became clear to me that it allows manipulation of the buttons, knobs, and switches just before polly posting, thank you.

It seems pass-through has been seen in other xml code for FG. Surely pass-through isn't always about manipulation. What is being passed-through? Just making pass-through bool and true, how does mice.xml know what to do with that?

Perhaps this is being overthought by me.
User avatar
innactpro
 
Posts: 54
Joined: Fri May 19, 2023 2:27 pm
Version: 2020.3.18
OS: Ubuntu 22.04 LTS

Re: Maximizing Trackball Buttons

Postby polly » Sat Jun 03, 2023 12:44 pm

It seems pass-through has been seen in other xml code for FG.


That is not helpful. Please, if you found something that contradicts what I described then say what it is and where you found it.
Mice.xml defines a data structure consisting of name:value that can specify actions, as bindings, or set a tag that specifies to other parts of the running program whether or not to act upon mouse actions.

If something is surely evident to you then please share.
User avatar
polly
 
Posts: 957
Joined: Thu Nov 04, 2010 3:45 pm

Re: Maximizing Trackball Buttons

Postby wkitty42 » Sat Jun 03, 2023 12:51 pm

innactpro wrote in Sat Jun 03, 2023 12:20 am:What is being passed-through? Just making pass-through bool and true, how does mice.xml know what to do with that?

you have to look at each code block as an entity... there's indention for a reason ;)

i'll cut this example down and clean up the indention a bit to make things clearer... and comments too!
it would maybe be a GoodThing<tm> to use a "programmers editor" that has the ability to collapse code blocks so you can more easily see what belongs to each block...

Code: Select all
<!-- indention in this example is 4 spaces to make the blocks more defined and easier to see -->
<PropertyList>

    <mouse n="0">                                               <!-- everything in this block is for the first mouse -->
        <mode-count type="int">4</mode-count>                   <!-- there are four modes of operation for this mouse -->
                                                                <!-- so there should be 4 separate mode blocks -->
        <mode archive="y" type="int">0</mode>
        <!-- -------------------------------------------------->
        <mode n="0">                                            <!-- everything in this block is for the first mouse when it is in mode 0 -->
            <cursor>inherit</cursor>
            <constrained type="bool">false</constrained>
            <pass-through type="bool">true</pass-through>

            <button n="0">                                      <!-- what the first button does in this mode -->
                <binding>
                    <condition>
                        <property>/sim/menubar/autovisibility/enabled</property>
                    </condition>
                    <command>property-assign</command>
                    <property>/sim/menubar/visibility</property>
                    <value type="bool">false</value>
                </binding>
            </button>                                           <!-- end of first button definition in this mode -->
                                                                <!-- button n=1 (the second button) is not defined in this mode -->
            <button n="2">                                      <!-- what the third button does in this mode -->
                <binding>
                    <command>cycle-mouse-mode</command>
                    <reason>right-click</reason>
                </binding>
            </button>                                           <!-- end of third button definition in this mode -->
 
            <!-- other buttons removed for simplicity -->

        </mode>                                                 <!-- end of the first mode of operation -->
        <!-- -------------------------------------------------->

        <!-- -------------------------------------------------->
        <mode n="1">                                            <!-- everything in this block is for the first mouse when it is in mode 1 -->
            <cursor>crosshair</cursor>
            <constrained type="bool">true</constrained>
            <pass-through type="bool">false</pass-through>

            <button n="2">                                      <!-- what the third button does in this mode -->
                blahblahblah
            </button>                                           <!-- end of third button definition in this mode -->

            <button n="3">                                      <!-- what the fourth button does in this mode -->
                blahblahblah
            </button>                                           <!-- end of fourth button definition in this mode -->
        </mode>                                                 <!-- end of the second mode of operation -->
        <!-- -------------------------------------------------->

        <!-- -------------------------------------------------->
        <!-- Mode 2: view mode -->
        <mode n="2">                                            <!-- everything in this block is for the first mouse when it is in mode 2 -->
            <cursor>left-right</cursor>
            <constrained type="bool">true</constrained>
            <pass-through type="bool">false</pass-through>

            <button n="0">                                      <!-- what the first button does in this mode -->
                blahblahblah
            </button>                                           <!-- end of first button definition in this mode -->

            <button n="1">                                      <!-- what the second button does in this mode -->
                blahblahblah
            </button>                                           <!-- end of first button definition in this mode -->

            <x-axis>                                            <!-- what moving the mouse in the x-axis does in this mode -->
                blahblahblah
            </x-axis>                                           <!-- end of x-axis definition in this mode -->

            <y-axis>                                            <!-- what moving the mouse in the y-axis does in this mode -->
                blahblahblah
            </y-axis>                                           <!-- end of y-axis definition in this mode -->
        </mode>                                                 <!-- end of the third mode of operation -->
        <!-- -------------------------------------------------->

        <!-- -------------------------------------------------->
        <!-- Mode 3: spring-loaded-view mode -->
        <mode n="3">                                            <!-- everything in this block is for the first mouse when it is in mode 3 -->
            <cursor>left-right</cursor>
            <constrained type="bool">true</constrained>
            <pass-through type="bool">false</pass-through>

            <x-axis>                                            <!-- what moving the mouse in the x-axis does in this mode -->
                blahblahblah
            </x-axis>                                           <!-- end of x-axis definition in this mode -->

            <y-axis>                                            <!-- what moving the mouse in the y-axis does in this mode -->
                blahblahblah
            </y-axis>                                           <!-- end of y-axis definition in this mode -->
        </mode>                                                 <!-- end of the fourth mode of operation -->
        <!-- -------------------------------------------------->

    </mouse>                                                    <!-- end of first mouse definitions -->

</PropertyList>


i hope this helps you to see the individual code blocks within code blocks more easily... indention is a huge factor in being able to visualize the blocks and code flow...

as far as "pass-through" specifically goes, i think that it means that when it is false, the button or axis movements are handled here in this block and not passed through to the other parts of the sim for more processing... if "pass-through" is true, then the button and axis movements are passed through to the rest of the sim... this can be seen here with the first mode of operation being pass-through true while the other three are false... the first mode of operation is normal mode where you can move the mouse anywhere you want in the sim... the other three modes are stepped through via the TAB key and the mouse has some restrictions and the buttons do certain things in each mode...
"You get more air close to the ground," said Angalo. "I read that in a book. You get lots of air low down, and not much when you go up."
"Why not?" said Gurder.
"Dunno. It's frightened of heights, I guess."
User avatar
wkitty42
 
Posts: 9148
Joined: Fri Feb 20, 2015 4:46 pm
Location: central NC, USA
Callsign: wk42
Version: git next
OS: Kubuntu 20.04

Re: Maximizing Trackball Buttons

Postby innactpro » Sat Jun 03, 2023 3:39 pm

polly wrote in Sat Jun 03, 2023 12:44 pm:Please, if you found something that contradicts what I described then say what it is and where you found it.

It isn't that anything contradicted your description, it's just that what pass-through does, it's function, was unclear to me.

wkitty42 wrote in Sat Jun 03, 2023 12:51 pm:as far as "pass-through" specifically goes, i think that it means that when it is false, the button or axis movements are handled here in this block and not passed through to the other parts of the sim for more processing... if "pass-through" is true, then the button and axis movements are passed through to the rest of the sim...

^This!^ is what my brain was failing to process. Thank you.

Opening and closing lines w/ <whatever>code</whatever> was understood. Indention for clarity was understood. That xml can be whatever you want it to be, got it. My lack of vocabulary concerning code is a huge limitation for me. What does pass-through mean? That it's confined or not, essentially. That's how my brain is processing it anyway.

There is more that isn't obvious to me. What is archive="y"? Is an archive being called or created, and in either case, what are the locations, or does it mean something else entirely?

All of which seems distracting from just being able to use all the buttons, and why an xml file in the event folder causes a fatal exception, though could potentially provide a clue. Of which, for me, many are indeed needed.

Is there some sort of primer for what's what in FG code and structure, for dummies? The wiki seems informative, just digging through everything to find something relevant to my situation, combined with my ignorance, is slow going.

The wiki 'Aircraft properties reference' seems like the correct path to get started. Is there something else anyone might suggest?
User avatar
innactpro
 
Posts: 54
Joined: Fri May 19, 2023 2:27 pm
Version: 2020.3.18
OS: Ubuntu 22.04 LTS

Re: Maximizing Trackball Buttons

Postby wkitty42 » Sat Jun 03, 2023 6:15 pm

innactpro wrote in Sat Jun 03, 2023 3:39 pm:There is more that isn't obvious to me. What is archive="y"? Is an archive being called or created, and in either case, what are the locations, or does it mean something else entirely?

archive="y" is whether the sim will write the property and its value to the autosave_XXXX_YY.xml file... XXXX_YY would be the major and minor portions of the FG version number... so 2020.3 for all of the different releases of the 2020.3 series for example... the autosave is loaded each time you start the sim so you'll mostly have the same settings as you did the last time you were in-sim...

i'm not sure how to respond to the rest of your post... my brain has 8 tracks with 12 trains and any two trains can jump track at any point... in other words, i don't know if i could really explain without losing track of where i was going... i do try, at times, but end up rambling on over several topics... sadly my hyperfocus hits when it wants and not always when i need or desire it...
"You get more air close to the ground," said Angalo. "I read that in a book. You get lots of air low down, and not much when you go up."
"Why not?" said Gurder.
"Dunno. It's frightened of heights, I guess."
User avatar
wkitty42
 
Posts: 9148
Joined: Fri Feb 20, 2015 4:46 pm
Location: central NC, USA
Callsign: wk42
Version: git next
OS: Kubuntu 20.04

Re: Maximizing Trackball Buttons

Postby innactpro » Sat Jun 03, 2023 7:02 pm

wkitty42 wrote in Sat Jun 03, 2023 6:15 pm:my brain has 8 tracks with 12 trains and any two trains can jump track at any point... sadly my hyperfocus hits when it wants and not always when i need or desire it...
You and me both.

So an archive is being created as autosave, correct?
User avatar
innactpro
 
Posts: 54
Joined: Fri May 19, 2023 2:27 pm
Version: 2020.3.18
OS: Ubuntu 22.04 LTS

Re: Maximizing Trackball Buttons

Postby wkitty42 » Sat Jun 03, 2023 7:12 pm

innactpro wrote in Sat Jun 03, 2023 7:02 pm:
wkitty42 wrote in Sat Jun 03, 2023 6:15 pm:my brain has 8 tracks with 12 trains and any two trains can jump track at any point... sadly my hyperfocus hits when it wants and not always when i need or desire it...
You and me both.

So an archive is being created as autosave, correct?

there's no specific archive being created... it means to archive (or not) that property and its value in the autosave file when exiting the sim...
"You get more air close to the ground," said Angalo. "I read that in a book. You get lots of air low down, and not much when you go up."
"Why not?" said Gurder.
"Dunno. It's frightened of heights, I guess."
User avatar
wkitty42
 
Posts: 9148
Joined: Fri Feb 20, 2015 4:46 pm
Location: central NC, USA
Callsign: wk42
Version: git next
OS: Kubuntu 20.04

Re: Maximizing Trackball Buttons

Postby innactpro » Sat Jun 03, 2023 7:31 pm

Got it. Thank you!

Just one more thing about mice.xml; there are four modes listed, though only three are cycled through using tab. What is that fourth mode and how is it accessed?
User avatar
innactpro
 
Posts: 54
Joined: Fri May 19, 2023 2:27 pm
Version: 2020.3.18
OS: Ubuntu 22.04 LTS

Re: Maximizing Trackball Buttons

Postby wkitty42 » Sat Jun 03, 2023 8:02 pm

i traced the "cycle-mouse-mode" routine to very last nasal code block in fgdata/Nasal/controls.nas... according to it, mode 1 is mouse controls flight controls, mode 2 is mouse controls view direction, and mode 3 is specifically set to mode 0 which is the normal mode you get when you start the sim... so it looks like controls.nas (inadvertently?) does not allow access to mode 3 because it is immediately reset to 0... this may not be a bug, though... it may be a temporary block of mode 3 because it may not work completely as desired...
"You get more air close to the ground," said Angalo. "I read that in a book. You get lots of air low down, and not much when you go up."
"Why not?" said Gurder.
"Dunno. It's frightened of heights, I guess."
User avatar
wkitty42
 
Posts: 9148
Joined: Fri Feb 20, 2015 4:46 pm
Location: central NC, USA
Callsign: wk42
Version: git next
OS: Kubuntu 20.04

Re: Maximizing Trackball Buttons

Postby innactpro » Sat Jun 03, 2023 8:22 pm

wkitty42 wrote in Sat Jun 03, 2023 8:02 pm:this may not be a bug, though... it may be a temporary block of mode 3 because it may not work completely as desired...

It also looks possibly redundant as it does much of what middle mouse will do in view mode.

Wow. Thanks for looking. There is so much to learn. And sorry for basically making this free private tutoring.

Trying to not take advantage of the 'free tutoring', what might be a good start in trying to determine the fatal exception caused by the MouseExtra.xml in the /Input/Event folder?
User avatar
innactpro
 
Posts: 54
Joined: Fri May 19, 2023 2:27 pm
Version: 2020.3.18
OS: Ubuntu 22.04 LTS

Re: Maximizing Trackball Buttons

Postby wkitty42 » Sun Jun 04, 2023 1:12 am

innactpro wrote in Sat Jun 03, 2023 8:22 pm:Trying to not take advantage of the 'free tutoring', what might be a good start in trying to determine the fatal exception caused by the MouseExtra.xml in the /Input/Event folder?

if you know how to operate gdb, running FG in gdb would be the place to start... when FG does the deed, gdb will tell exactly where that happened... then by looking at the output, one can determine what the problem is...

on the "free tutorial" front, don't worry about it... we all started somewhere somehow ;)
"You get more air close to the ground," said Angalo. "I read that in a book. You get lots of air low down, and not much when you go up."
"Why not?" said Gurder.
"Dunno. It's frightened of heights, I guess."
User avatar
wkitty42
 
Posts: 9148
Joined: Fri Feb 20, 2015 4:46 pm
Location: central NC, USA
Callsign: wk42
Version: git next
OS: Kubuntu 20.04

Re: Maximizing Trackball Buttons

Postby innactpro » Sun Jun 04, 2023 2:21 am

wkitty42 wrote in Sun Jun 04, 2023 1:12 am:if you know how to operate gdb, running FG in gdb would be the place to start...

Not knowing is half of losing the battle.

And just my luck, gdb says 'No debugging symbols found'. As this is my first time running gdb, that is most likely me again doing something incorrectly.
User avatar
innactpro
 
Posts: 54
Joined: Fri May 19, 2023 2:27 pm
Version: 2020.3.18
OS: Ubuntu 22.04 LTS

Re: Maximizing Trackball Buttons

Postby innactpro » Sun Jun 04, 2023 3:23 am

Alright, after a second attempt apparently doing things more correctly, while still not knowing what was wrong the first time, gdb said,
not well-formed (invalid token)
at /media/jason/Data/FlightGear/FlightGear.appimage,
line 1, column 0

received from SimGear XML Parser
And this is without the MouseExtra.xml yet in the Event folder. So there is something else going on here, seemingly unrelated, though still could be.

This does seem to be with my computer because the extra mouse thing worked for polly.
User avatar
innactpro
 
Posts: 54
Joined: Fri May 19, 2023 2:27 pm
Version: 2020.3.18
OS: Ubuntu 22.04 LTS

Re: Maximizing Trackball Buttons

Postby wkitty42 » Sun Jun 04, 2023 11:57 am

i didn't realize you were using the appimage... i have no idea how to tell gdb to run the FG it contains... the binary not having debug symbols also makes it a little harder to trace the flow but not impossible...




FWIW: i prefer to build my own FG on (debian-based) linux using the download_and_compile.sh script (aka dnc)... the FG that's built and installed is private for your user only... you can build the latest LTS in release or debug modes as well as the same for the next branch... if you are interested, you can find instructions here...

dnc is a very capable system and other than the initial build taking a while to run (especially if building OSG) most of my update builds are done and completed in less than 5 minutes... but since i build and run the next branch, mostly, i update a lot more frequently than the LTS branch would be updated... the next branch is the bleeding edge, in case you didn't know... the LTS is the Long Term Support branch and is much more stable... [edit] one of the nice things about dnc is that it will also install everything needed for building everything... [/edit]
Last edited by wkitty42 on Mon Jun 05, 2023 11:03 am, edited 2 times in total.
"You get more air close to the ground," said Angalo. "I read that in a book. You get lots of air low down, and not much when you go up."
"Why not?" said Gurder.
"Dunno. It's frightened of heights, I guess."
User avatar
wkitty42
 
Posts: 9148
Joined: Fri Feb 20, 2015 4:46 pm
Location: central NC, USA
Callsign: wk42
Version: git next
OS: Kubuntu 20.04

Re: Maximizing Trackball Buttons

Postby innactpro » Sun Jun 04, 2023 6:07 pm

Yeah, my history of compiling from source is mostly failure. It even took two or three attempts to get gdb installed and running. So debs and then appimages have been my friends for quite some time, and always stable versions, with LTS if available.

However, my thinking was to remove everything FG on my computer and redownloading the appimage in case something happened during all of that. Then maybe make another effort to compile from source. Maybe even up the eight buttons to twelve (how daring). Because it did occur to me that the appimage version could be the problem with the event xml. Though also, why would it?

But give me some time to do some experimenting, as well taking care of some other projects, then see what's what.
User avatar
innactpro
 
Posts: 54
Joined: Fri May 19, 2023 2:27 pm
Version: 2020.3.18
OS: Ubuntu 22.04 LTS

PreviousNext

Return to Hardware

Who is online

Users browsing this forum: No registered users and 5 guests