Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
can someone confirm this runs on their system?
#11
I tried it. I ran it in Linux Mint 21.2, QB64pe 3.10.0 and it compiled and ran but I had no luck getting any of the the players to move around, and the escape key would not function.

Thinking it may be a problem with Linux. I loaded it up in Win10 VM with QB64pe 3.10.0 and tried it, and it played just fine.

I tried it on my Ubuntu machine and I could not move the players around.

In regards to Linux, there seems to be an issue with keyboard handling during game play.

Perhaps someone else can confirm this?
Reply
#12
(12-21-2023, 12:20 AM)justsomeguy Wrote: I tried it. I ran it in Linux Mint 21.2, QB64pe 3.10.0 and it compiled and ran but I had no luck getting any of the the players to move around, and the escape key would not function.

Thinking it may be a problem with Linux. I loaded it up in Win10 VM with QB64pe 3.10.0 and tried it, and it played just fine.

I tried it on my Ubuntu machine and I could not move the players around.

In regards to Linux, there seems to be an issue with keyboard handling during game play.

Perhaps someone else can confirm this?
Thanks for testing! 
It must be a problem with the _BUTTON command which is what it uses to read the keyboard.
If you want to isolate just that functionality, see the little test program I posted in my previous reply (regarding numlock). 
Thanks again!
Reply
#13
I did run your test program and have had the same result. 

I found this code snippet in the help and ran it.

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%

Print
Do
    x% = _DeviceInput
    If x% Then Print "Device ="; x%;
Loop Until InKey$ = Chr$(27)

End

'_DeviceInput' never fired when touching the keyboard, only the mouse did.
Reply
#14
(12-21-2023, 01:01 AM)justsomeguy Wrote: I did run your test program and have had the same result. 

I found this code snippet in the help and ran it.

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%

Print
Do
    x% = _DeviceInput
    If x% Then Print "Device ="; x%;
Loop Until InKey$ = Chr$(27)

End

'_DeviceInput' never fired when touching the keyboard, only the mouse did.
Interesting... So do we put that under "bugs"?
Reply
#15
I went ahead and submitted a bug report.
Reply
#16
The following code from lesson 21 of the tutorial works on my system to detect interaction between the mouse, keyboard, and a dpad controller I have connected. Look at line 22 of the code. You need to get the latest _DEVICEINPUT information in the same way you need to get _MOUSEINPUT, using a loop.

Code: (Select All)
DIM DeviceCount AS INTEGER ' number of controllers (simply used to activate controller statements)
DIM DeviceInput AS INTEGER ' indicates a controller has been interacted with

PRINT
PRINT " Interact with an input controller and it will highlight."
PRINT
PRINT " Press ESC to exit program."
PRINT
DeviceCount = _DEVICES '                                         activate controller statements
DO '                                                             begin controller interaction loop
    _LIMIT 10 '                                                   slow things down a bit for viewing
    LOCATE 6, 1 '                                                 position cursor
    COLOR 7, 0 '                                                  gray on black text
    PRINT " Keyboard" '                                           list controllers
    PRINT " Mouse"
    PRINT " Controller 1"
    PRINT " Controller 2"
    PRINT " Controller 3"
    PRINT " Controller 4"
    DeviceInput = _DEVICEINPUT '                                 get any controller interaction
    IF DeviceInput THEN '                                         was a controller interacted with?
        WHILE _DEVICEINPUT(DeviceInput): WEND '                   yes, get the latest controller information
        COLOR 14, 1 '                                             yellow on blue text
        IF DeviceInput = 1 THEN '                                 was the keyboard interacted with?
            LOCATE 6, 1 '                                         yes, position cursor
            PRINT " Keyboard" '                                   highlight controller
        ELSEIF DeviceInput = 2 THEN '                             no, was the mouse interacted with?
            LOCATE 7, 1 '                                         yes, position cursor
            PRINT " Mouse" '                                      highlight controller
        ELSE '                                                    no, a joystick/game pad interacted with
            LOCATE 5 + DeviceInput, 1 '                           position cursor
            PRINT " Controller "; _TRIM$(STR$(DeviceInput - 2)) ' highlight controller
        END IF
    END IF
LOOP UNTIL _KEYDOWN(27) '                                        leave when ESC key pressed
SYSTEM '                                                         return to OS
New to QB64pe? Visit the QB64 tutorial to get started.
QB64 Tutorial
Reply
#17
(12-21-2023, 03:54 AM)TerryRitchie Wrote: The following code from lesson 21 of the tutorial works on my system to detect interaction between the mouse, keyboard, and a dpad controller I have connected. Look at line 22 of the code. You need to get the latest _DEVICEINPUT information in the same way you need to get _MOUSEINPUT, using a loop.

Code: (Select All)
DIM DeviceCount AS INTEGER ' number of controllers (simply used to activate controller statements)
DIM DeviceInput AS INTEGER ' indicates a controller has been interacted with

PRINT
PRINT " Interact with an input controller and it will highlight."
PRINT
PRINT " Press ESC to exit program."
PRINT
DeviceCount = _DEVICES '                                         activate controller statements
DO '                                                             begin controller interaction loop
    _LIMIT 10 '                                                   slow things down a bit for viewing
    LOCATE 6, 1 '                                                 position cursor
    COLOR 7, 0 '                                                  gray on black text
    PRINT " Keyboard" '                                           list controllers
    PRINT " Mouse"
    PRINT " Controller 1"
    PRINT " Controller 2"
    PRINT " Controller 3"
    PRINT " Controller 4"
    DeviceInput = _DEVICEINPUT '                                 get any controller interaction
    IF DeviceInput THEN '                                         was a controller interacted with?
        WHILE _DEVICEINPUT(DeviceInput): WEND '                   yes, get the latest controller information
        COLOR 14, 1 '                                             yellow on blue text
        IF DeviceInput = 1 THEN '                                 was the keyboard interacted with?
            LOCATE 6, 1 '                                         yes, position cursor
            PRINT " Keyboard" '                                   highlight controller
        ELSEIF DeviceInput = 2 THEN '                             no, was the mouse interacted with?
            LOCATE 7, 1 '                                         yes, position cursor
            PRINT " Mouse" '                                      highlight controller
        ELSE '                                                    no, a joystick/game pad interacted with
            LOCATE 5 + DeviceInput, 1 '                           position cursor
            PRINT " Controller "; _TRIM$(STR$(DeviceInput - 2)) ' highlight controller
        END IF
    END IF
LOOP UNTIL _KEYDOWN(27) '                                        leave when ESC key pressed
SYSTEM '                                                         return to OS
I still got no response from the keyboard.
Reply
#18
(12-21-2023, 04:08 AM)justsomeguy Wrote:
(12-21-2023, 03:54 AM)TerryRitchie Wrote: The following code from lesson 21 of the tutorial works on my system to detect interaction between the mouse, keyboard, and a dpad controller I have connected. Look at line 22 of the code. You need to get the latest _DEVICEINPUT information in the same way you need to get _MOUSEINPUT, using a loop.

Code: (Select All)
DIM DeviceCount AS INTEGER ' number of controllers (simply used to activate controller statements)
DIM DeviceInput AS INTEGER ' indicates a controller has been interacted with

PRINT
PRINT " Interact with an input controller and it will highlight."
PRINT
PRINT " Press ESC to exit program."
PRINT
DeviceCount = _DEVICES '                                         activate controller statements
DO '                                                             begin controller interaction loop
    _LIMIT 10 '                                                   slow things down a bit for viewing
    LOCATE 6, 1 '                                                 position cursor
    COLOR 7, 0 '                                                  gray on black text
    PRINT " Keyboard" '                                           list controllers
    PRINT " Mouse"
    PRINT " Controller 1"
    PRINT " Controller 2"
    PRINT " Controller 3"
    PRINT " Controller 4"
    DeviceInput = _DEVICEINPUT '                                 get any controller interaction
    IF DeviceInput THEN '                                         was a controller interacted with?
        WHILE _DEVICEINPUT(DeviceInput): WEND '                   yes, get the latest controller information
        COLOR 14, 1 '                                             yellow on blue text
        IF DeviceInput = 1 THEN '                                 was the keyboard interacted with?
            LOCATE 6, 1 '                                         yes, position cursor
            PRINT " Keyboard" '                                   highlight controller
        ELSEIF DeviceInput = 2 THEN '                             no, was the mouse interacted with?
            LOCATE 7, 1 '                                         yes, position cursor
            PRINT " Mouse" '                                      highlight controller
        ELSE '                                                    no, a joystick/game pad interacted with
            LOCATE 5 + DeviceInput, 1 '                           position cursor
            PRINT " Controller "; _TRIM$(STR$(DeviceInput - 2)) ' highlight controller
        END IF
    END IF
LOOP UNTIL _KEYDOWN(27) '                                        leave when ESC key pressed
SYSTEM '                                                         return to OS
I still got no response from the keyboard.
I'm still using 3.8.0 which worked fine. I just tried it in 3.9.1 and it worked fine. I have not downloaded version 3.10.0 yet. Is this a bug in version 3.10.0?

Update: Ok, my bad, I just went back through the posts and see this is related to Linux. I'm using Windows. Sorry for the confusion.
New to QB64pe? Visit the QB64 tutorial to get started.
QB64 Tutorial
Reply
#19
(12-21-2023, 03:39 AM)justsomeguy Wrote: I went ahead and submitted a bug report.

This is going to be a PITA to resolve on Linux. Because apparently the switch is being made to "libinput", especially away from "synclient" and other programs that previously handled the keyboard, mouse and/or touchpad. In my case, I prefer "synclient" because I hate MacOS "touch field" mode where anywhere has to scroll and some web page "needs" to scroll against my wishes. It lets me disable any scroll technique because I'm clumsy using a touchpad. Also the annoying tap-to-click.

However "libinput" forces me to take up a valuable USB port of my budget laptop to have a wireless keyboard and mouse combo by Logitech. That's great only if I had a full desk for it. I don't have room next to the computer for an entire mouse pad, and even less room for a near-full-featured keyboard.

I don't know how this relates to FreeGLUT or whatever QB64 is using to read HID.

Another thing that's surprising is that wireless keyboard I have doesn't even have a light for Numlock. It does for Capslock. Go figure.
Reply




Users browsing this thread: 3 Guest(s)