SO, I went out and bought a new XBOX controller..... works for X/S and Xbox One.
Tested it on the html5 build, and it detected it fine.
The only issue is that it is an enhanced controller with extra buttons, and those do not show up as regular joystick button inputs.
However, all of the other normal controls (The Xbox One buttons) are being recognized and worked fine.
So, the old threads must have been before an update that addressed the HTML Joystick Controller issues.
I still don't have an Xbox One to test, but if the HTML5 builds that get converted to UWP via VS 2017 do not work right on Xbox One consoles, then the issue is with the Xbox, because they run fine on Windows 10 with the UWP.
If this has been working fine all this time, then I am wondering why there are not a bunch of Xbox releases in the showcase.
As one person mentioned, an HTML game on an Xbox is like having a Ferrari pulling a lawn mower trailer, but games like 'Gems of War' and other casual games rated 'E' seem to be doing well with 2d graphics.
The user base of the Xbox is huge, and I for one am going to play there. (once I have something posted (probably slots or something simple) then I will be sure to post it in the showcase.
Maybe I am just behind the times on this one, but I thought I would share my discoveries in case others are as confused about the Xbox compatibility as I was.
EDIT
So, all in good fun... I went ahead and mixed and matched the new Xbox One X/S controller and the old Xbox360 controller, and they work fine together on Windows 10 (UWP) converted from AppGameKit HTML5 builds.
Have fun, I know I am...
// Project: joystick_controls
// Created: 2021-06-14
// show all errors
SetErrorMode(2)
// set window properties
SetWindowTitle( "joystick_controls" )
SetWindowSize( 1024, 768, 0 )
SetWindowAllowResize( 1 ) // allow the user to resize the window
// set display properties
SetVirtualResolution( 1024, 768 ) // doesn't have to match the window
SetOrientationAllowed( 1, 1, 1, 1 ) // allow both portrait and landscape on mobile devices
SetSyncRate( 90, 0 ) // 30fps instead of 60 to save battery
SetScissor( 0,0,0,0 ) // use the maximum available screen space, no black borders
UseNewDefaultFonts( 1 ) // since version 2.0.22 we can use nicer default fonts
CompleteRawJoystickDetection()
do
if GetRawJoystickExists( 1 ) = 1 then exit
Print ( " " )
Print ( " Xbox Controller for PLAYER 1 was NOT DETECTED...please press/hold the left trigger " )
sync()
loop
do
if GetRawJoystickExists( 2 ) = 1 then exit
Print ( " " )
Print ( " Xbox Controller for PLAYER 2 was NOT DETECTED...please press/hold the left trigger " )
sync()
loop
do
Print( ScreenFPS() )
Print(" ")
Print( GetRawJoystickX( 1 ) ) // Display Left Joystick 1 Inputs
Print( GetRawJoystickY( 1 ) )
Print( GetRawJoystickRX( 1 ) ) // Display Right Joystick 1 Inputs
Print( GetRawJoystickRY( 1 ) )
Print(GetRawJoystickZ( 1 ) ) // Disply the Left Trigger Input - Axis Floats for sensitivity
Print(GetRawJoystickRZ( 1 ) ) // Disply the Right Trigger Input
Print(" ")
Print(" ")
Print( GetRawJoystickX( 2 ) ) // Display Left Joystick 2 Inputs
Print( GetRawJoystickY( 2 ) )
Print( GetRawJoystickRX( 2 ) ) // Display Right Joystick 2 Inputs
Print( GetRawJoystickRY( 2 ) )
Print(GetRawJoystickZ( 2 ) ) // Disply the Left Trigger Input - Axis Floats for sensitivity
Print(GetRawJoystickRZ( 2 ) ) // Disply the Right Trigger Input
Print(" ")
for r = 1 to 64
if GetRawJoystickButtonPressed( 1, r )
z=r
endif
if GetRawJoystickButtonPressed( 2, r )
zz=r
endif
next r
Print( z ) // Display Value of Last Joystick 1 Button Pressed
Print(" ")
Print( zz ) // Display Value of Last Joystick 2 Button Pressed
Sync()
loop
It seems like they will both be detected simultaneously, if already plugged in, once that trigger is held a couple seconds.
So.... I unplugged the second one, just to make sure I was not bypassing the Joystick 2 check, and it prompted me... then as soon as I plugged it in, it recognized it on its own.
It seems that the entire index is dependent on the first one being recognized, so if you have a RockBand or other 'dongle' in the Controller 1 slot on the Xbox, then it could be an problem. (untested)
Anyway, I am glad I have been playing around with the HTL5 builds recently, because that is going to pay off on some split screen action. (been dreaming about a Xenophobe type split screen)
Finally can have some multiplayer fun on a leading cutting edge console.... Happy days! (yeah yeah other fancy engines that require teams, but for simple indies like me this really shines!)
EDIT
Well, is seems that the
Microsoft Store Policies are really 'E' rated and not for anything with adult content, or any kind of violence.
So, Casino is out... gambling.
All Shooters are out ...violence.
Puzzle games and Driving Games (off road) seem to be about it... bummer dudes.
Coding things my way since 1981 -- Currently using AppGameKit V2 Tier 1