XBox Controllers Plugin

Questions and comments specific to a particular plugin should go here.

Re: XBox Controllers Plugin

Postby kgschlosser » Wed Jun 07, 2017 11:40 pm

ok so here goes this has the mouse added to it and the other errors fixed as well. Hopefully

there are 2 new actions for enabling and disabling the mouse

i did them as actions that way if there is a specific event that takes place where you would want to the controller to be able to switch from mouse to non mouse you can
If you like the work I have been doing then feel free to Image
User avatar
kgschlosser
Site Admin
 
Posts: 2702
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: XBox Controllers Plugin

Postby Diz » Thu Jun 08, 2017 2:15 am

ummm... something went wrong!

03:12:14 Exception in thread eg.CorePluginModule.XBoxControllers.Controller1:
03:12:14 Traceback (most recent call last):
03:12:14 File "threading.pyc", line 801, in __bootstrap_inner
03:12:14 File "threading.pyc", line 754, in run
03:12:14 File "D:\Automation\EventGhost\plugins\XBoxControllers\__init__.py", line 1147, in update
03:12:14 BATTERY_TYPES[bat_type],
03:12:14 KeyError: -1
03:12:14
Diz
Experienced User
 
Posts: 121
Joined: Tue Jan 10, 2017 4:49 pm

Re: XBox Controllers Plugin

Postby Diz » Thu Jun 08, 2017 3:01 am

after some poking around i know whats happening here... but i dont know why its happening! the older versions picked up my battery type as 255 decimal which equates to 'unknown'. this new version picks up my battery type as -1 decimal which isnt checked for! so i added an equate in the battery types for -1 and all is well! :D

using the same xinput dll how can the battery type give two different results? :lol:

unfortunately the mouse mode thingy wont work for me. when i enable it no errors are given and it says its enabled but the analog stick just behaves as normal and then when i disable mouse mode then the errors hit:

04:10:00 XBox Controllers: Disable Mouse Control: Controller 1
04:10:00 Error in Action: "XBox Controllers: Disable Mouse Control: Controller 1"
04:10:00 Traceback (most recent call last) (0.5.0-rc2):
04:10:00 File "D:\Automation\EventGhost\eg\Classes\ActionBase.py", line 116, in CallWrapper
04:10:00 return self(*args)
04:10:00 TypeError: __call__() takes exactly 2 arguments (1 given)
Diz
Experienced User
 
Posts: 121
Joined: Tue Jan 10, 2017 4:49 pm

Re: XBox Controllers Plugin

Postby kgschlosser » Thu Jun 08, 2017 3:29 am

ok i fixed that traceback issue. not sure why its doing that all of a sudden for the battery. but I now have it checking to make sure the -1 won't throw the error again

I also fixed the enable not working. not sure why the disable isn't but I want you to try it again. i also changed the enable mouse action to have defaulted values this way if someone doesn't run configure on it it will not error. I am also changed the disable so you will not have to select a controller it will simply disable which ever controller is running it. because i have it set up so that only one controller can control it at a time.
If you like the work I have been doing then feel free to Image
User avatar
kgschlosser
Site Admin
 
Posts: 2702
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: XBox Controllers Plugin

Postby Diz » Thu Jun 08, 2017 3:37 am

ok... wow! ummm... the mouse thing kinda works but its upsidedown and back to front and is rediculously fast and uncontrollable! the disable action still throws the same error. also the button repeats are very fast and do not slow down when held like before
Diz
Experienced User
 
Posts: 121
Joined: Tue Jan 10, 2017 4:49 pm

Re: XBox Controllers Plugin

Postby Diz » Thu Jun 08, 2017 3:42 am

and now it doesnt even tell me about my battery level or anything
Diz
Experienced User
 
Posts: 121
Joined: Tue Jan 10, 2017 4:49 pm

Re: XBox Controllers Plugin

Postby kgschlosser » Thu Jun 08, 2017 5:02 am

ok the mouse thing is positional. what that means is if you center the stick it will move the mouse to the center of the screen. if you move the stick 1/2 way to the left it will move the mouse to the left helf the distance from the center of the screen.

if you then let go of the controller and let it snap back to the center it will move the mouse back to the center. it's going to be fast.. it doesn't slide the mouse. it simply moves it.


so this is how it's laid out. the numbers are x, y coordinates for position of the joystick the 3 rows are are as an example and the joystick outputs everything in between as well

Code: Select all
  left top                center top                 right top


left center                 center                  right center


left bottom             center bottom               right bottom



the numbers returned from the joystick are as follows

Code: Select all
-35537, 35537            0, 35537                  35537, 35537


  -35537, 0                0, 0                      35537, 0


-35537, -35537           0, -35537                 35537, -35537



and if you had a 1080P screen they would be this

Code: Select all
  0, 0               960, 0                   1920, 0


0, 540              960, 540                 1920, 540


0, 1080            960 , 1080                1920, 1080


so on the controller 0, 0 is 960, 540 on the monitor.
so if you move the joy half way to the left which would be -17768, 0 which would be 480, 540 on the screen if you hold the joystick in that position the mouse will not move

if you let go of the joy the mouse will go back to the middle of the screen. so the position of the stick will map to the exact same spot on the screen.

the button repeats should be fast. it is as fast as it would be if you were tapping the button as fast as you could. it is not supposed to slow down it is spitting out a repeat event at 1/2 the speed of the polling and I have found that the polling is typically between 80 milliseconds and 60 milliseconds. if you would count the number of repeat events that take place in one second i will be able to tell how fast it's going. you will need to turn on the time stamp for the logging.
If you like the work I have been doing then feel free to Image
User avatar
kgschlosser
Site Admin
 
Posts: 2702
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: XBox Controllers Plugin

Postby kgschlosser » Thu Jun 08, 2017 5:13 am

and if you did not delete the actions and remove the plugin and then install the plugin you will have to delete the disable mouse action and re add it.
If you like the work I have been doing then feel free to Image
User avatar
kgschlosser
Site Admin
 
Posts: 2702
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: XBox Controllers Plugin

Postby Diz » Thu Jun 08, 2017 12:44 pm

i did reinstall for the actions in the first place. and the mouse thing just isnt working as you intended! lol
Diz
Experienced User
 
Posts: 121
Joined: Tue Jan 10, 2017 4:49 pm

Re: XBox Controllers Plugin

Postby kgschlosser » Thu Jun 08, 2017 2:49 pm

this is why it's being tested. I need to know step for step what it's going and what it's not doing. move it only one direction and explain what it is doing
If you like the work I have been doing then feel free to Image
User avatar
kgschlosser
Site Admin
 
Posts: 2702
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: XBox Controllers Plugin

Postby Diz » Thu Jun 08, 2017 3:15 pm

ok first off up and down are definitely inverted!

secondly it NEVER returns to the centre of the screen!

and third there is no movement from the pointer until you reach like two thirds distance movement on the stick! so you can only move to the outer few inches on any edge of the screen

and the disable action still throws the error
Diz
Experienced User
 
Posts: 121
Joined: Tue Jan 10, 2017 4:49 pm

Re: XBox Controllers Plugin

Postby kgschlosser » Thu Jun 08, 2017 5:43 pm

ok i will check it out. and what is the error the disable action is throwing?
If you like the work I have been doing then feel free to Image
User avatar
kgschlosser
Site Admin
 
Posts: 2702
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: XBox Controllers Plugin

Postby kgschlosser » Thu Jun 08, 2017 5:45 pm

never mind about the disable action. I found the problem.
If you like the work I have been doing then feel free to Image
User avatar
kgschlosser
Site Admin
 
Posts: 2702
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: XBox Controllers Plugin

Postby kgschlosser » Thu Jun 08, 2017 5:49 pm

ok here is another version. this is going to have a checkbox to either use absolute positioning for the mouse or not. and the disable mouse should be fixed
If you like the work I have been doing then feel free to Image
User avatar
kgschlosser
Site Admin
 
Posts: 2702
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: XBox Controllers Plugin

Postby Diz » Thu Jun 08, 2017 6:11 pm

disable mouse is fixed

absolute positioning mode is exactly the same as before

the new mode only goes up and right no matter what direction i push!
Diz
Experienced User
 
Posts: 121
Joined: Tue Jan 10, 2017 4:49 pm

PreviousNext

Return to Plugin Support

Who is online

Users browsing this forum: No registered users and 7 guests