Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Controller Library
#11
UPDATE:

The library has been updated to version 1.10

The original post at the top of this thread has been updated with all the details and new ZIP file to download.

Additions to this version:

NOTE: This library will now require QB64PE version 3.7.0 and above.

- Save and load user defined buttons ( __LOAD_BUTTONS, __SAVE_BUTTONS )
- The ability to detect new controllers plugged and existing controllers unplugged/plugged back in ( __NEW_CONTROLLER, __CONNECTED )
- Remove all controller associated user defined buttons ( __REMOVE_CONTROLLER )
- Prior versions automatically created buttons based on integer variables. A change was needed to facilitate the loading of saved button configurations.
  __MAKE_BUTTON is now required to initialize user defined buttons (see documentation in CONTROLLER.BI for more info).


The mini-game, "Configure_Buttons.BAS", along with the other three example programs have been updated to highlight the new features.
New to QB64pe? Visit the QB64 tutorial to get started.
QB64 Tutorial
Reply
#12
Hi Terry,

Just wanted to let you know that the `Configure_Buttons.bas` example does not work correctly in Linux and macOS.

I was expecting it to respond to the keyboard, but it does not respond to anything. The only thing that works is ESC. That is because you are using `_KEYDOWN(27)` to terminate the main loop.

I've checked with v3.8.0 and older versions as well.

Currently, I am not sure what the root cause is, but I'll check later when I get some time.
Reply
#13
(09-25-2023, 09:41 PM)a740g Wrote: Hi Terry,

Just wanted to let you know that the `Configure_Buttons.bas` example does not work correctly in Linux and macOS.

I was expecting it to respond to the keyboard, but it does not respond to anything. The only thing that works is ESC. That is because you are using `_KEYDOWN(27)` to terminate the main loop.

I've checked with v3.8.0 and older versions as well.

Currently, I am not sure what the root cause is, but I'll check later when I get some time.
Thank you for the heads up. I don't have a Mac but I can run the code in Linux to see if I can determine what's going on.
New to QB64pe? Visit the QB64 tutorial to get started.
QB64 Tutorial
Reply
#14
Also now with the new version of QB64pe 4.2.0  the issue raised up by a740g stands here.
No the same opportunity for Linux/ Mac users...for using your wonderful library!
Reply
#15
Listen,

YOU ARE ALL GENIUSES so do it yourselves!

Me and Terry are old mates so im pretty sure he wont mind me saying...MAKE YOUR OWN FUNCTIONS/LIBS! 

Basically it like this....as much as me, him and all OG's here will help with most anything...sometimes you gotta do this stuff yourselves!  We OG's only learnt from making mistakes, testing and oh so much DEV! QB64 has changed at bit since this lib and many other libs where created so you guys need to adapt them! 

Now man UP!

John
Reply
#16
HI Unseen
yeah with trials and horrors I can build up another library which joins Keyboard, mouse and Joystick input.
I dig just a bit so i can  say that the issue is coming out from the Linux version of Keyword _DEVICEINPUT....
so before to build up a my library I must avoid this QB64pe keyword because in Windows it seems to work good, but in Linux and Mac no. 
here the code test:
Code: (Select All)

For i% = 1 To _Devices
    Print Str$(i%) + ") " + _Device$(i%)
    Print "Button:"; _LastButton(i%); ",Axis:"; _LastAxis(i%); ",Wheel:"; _LastWheel(i%)
Next i%
_Delay 2
Print
Print "Testing mouse..."
Print "please press mouse buttons..rotate wheel to quit test"
done = -1
MaxB = _LastButton(2)
While done
    x% = _DeviceInput(2)
    If x% Then
        For x% = 1 To MaxB
            If _Button(x%) Then Print "Button "; x$;
            If _Wheel(3) Then Print "Wheel 3 exiting mouse test": done = 0
            If InKey$ = Chr$(27) Then done = 0 ' escape code control
        Next
    End If
Wend
_Delay 2
Print
Print "Testing Joystick..."
Print "please press joystick buttons... button 1 to quit test"
done = -1
MaxB = _LastButton(3)
While done
    x% = _DeviceInput(3)
    If x% Then
        For x% = 1 To MaxB
            If _Button(x%) Then
                Print "Button "; x%;
                If _Button(1) Then
                    done = 0
                    Print "Button 1 exiting Joystick test...."
                End If
            End If
            If InKey$ = Chr$(27) Then done = 0 ' escaping secure code
        Next
    End If
Wend
_Delay 2
Print
Print "Testing Keyboard..."
Print "please press keyboard keys... press ESCape to quit test"
done = -1
MaxB = _LastButton(1)
While done
    x% = _DeviceInput(1)
    If x% Then
        For x% = 1 To MaxB
            If _Button(x%) Then
                Print "Button "; x%;
                If _Button(2) Then
                    done = 0
                    Print "Button 2 exiting Keyboard test..."
                End If
            End If
            If InKey$ = Chr$(27) Then done = 0 ' escaping secure code
        Next
    End If
Wend


End

and here the explicative screenshot.


[Image: k-EYBOARD-DEVICEINPUT-DOESNT-WORK.jpg]


What's the matter? I write a code in Windows and another QB64pe friend cannot evaluate it in Linux or Mac...So my app/game/tool is unuseful for the QB64pe users that living in that OSes.
In this specific case the issue is _DEVICEINPUT, but surely there are other cases like this.... 
for examples if you take my QB64pe speed Bible source code and try to compile it in Linux you get so many errors. At first time I believed that the main issue was that the Inform product was so bind to OSes resource like font files and images.  Nope also changing all the resources pointing to local resources on the machine with Linux it stucks up. I tried to design again the GUI using Informpe in Linux... Well It stucked again... So I tried to make a similar application for a BASH training using the same structure (no the same files!) made with Informpe in Linux.... well it stucks again... there is some basic keyword that has not the same working behaviour between Windows and Linux version...
So that tool has loosen so much interest at my eyes... for now I must code in windows for windows app and in Linux for some kind apps for Linux... The multiplatform feature falls down... there are version for different platforms, and this is not the same thing.


But Thanks for letting me explain why I do echo to an old post by a740g,
I agree with you expecially with write yourself the workaround or adapt this library to actual QB64pe version...

and be patient I have many posts to attach at your threads, but I am slow to reach the result that I should like to show to you and to community (naturally about your threads)
As can you see in the forum I like your libraries and I test your demos... for some months also in Linux, and the code tested for now doesn't fall in this trans-OS issue. 
Shy
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Terry Ritchie's Sprite Library admin 3 1,990 08-17-2022, 12:29 AM
Last Post: TempodiBasic
  Graphic Line Input Library admin 0 1,012 04-20-2022, 02:30 PM
Last Post: admin
  Menu Library admin 0 1,183 04-20-2022, 02:29 PM
Last Post: admin
  Button Library admin 0 968 04-20-2022, 02:28 PM
Last Post: admin

Forum Jump:


Users browsing this thread: