If you have a problem or need to report a bug please email : support@dsprobotics.com
There are 3 sections to this support area:
DOWNLOADS: access to product manuals, support files and drivers
HELP & INFORMATION: tutorials and example files for learning or finding pre-made modules for your projects
USER FORUMS: meet with other users and exchange ideas, you can also get help and assistance here
NEW REGISTRATIONS - please contact us if you wish to register on the forum
Users are reminded of the forum rules they sign up to which prohibits any activity that violates any laws including posting material covered by copyright
Controller Xbox360
16 posts
• Page 1 of 2 • 1, 2
Controller Xbox360
Hi,
I would like programming xbox controller with code like AHK (AutohotKey)
but i'm not used to code with Ruby. Can u help me to assign Button A to F1 function ?
If you have any documentation about programming controller, i will appreciate it !
Many thx !
I would like programming xbox controller with code like AHK (AutohotKey)
but i'm not used to code with Ruby. Can u help me to assign Button A to F1 function ?
If you have any documentation about programming controller, i will appreciate it !
Many thx !
- Attachments
-
- xbox360.fsm
- (25.21 KiB) Downloaded 1625 times
- Almeida
- Posts: 10
- Joined: Wed Jun 12, 2013 12:43 pm
Re: Controller Xbox360
Here are two modules that send key status messages to the current active window. It uses win32Api, which is a little bit hard to read. Check the FS user guide (page 198-201)
- Attachments
-
- key strokes (MyCo).fsm
- (26.64 KiB) Downloaded 1728 times
-
MyCo - Posts: 718
- Joined: Tue Jul 13, 2010 12:33 pm
- Location: Germany
Re: Controller Xbox360
0x70 is just hexadecimal, you can use the windows calculator to convert it into decimal, or just use an online converter like this:
http://www.rapidtables.com/convert/numb ... ecimal.htm
Or you can use FS "hex to dec" primitive
Edit: Looks like you found your answer already
http://www.rapidtables.com/convert/numb ... ecimal.htm
Or you can use FS "hex to dec" primitive
Edit: Looks like you found your answer already
-
MyCo - Posts: 718
- Joined: Tue Jul 13, 2010 12:33 pm
- Location: Germany
Re: Controller Xbox360
yes i found it finally but can help other ! thx
- Almeida
- Posts: 10
- Joined: Wed Jun 12, 2013 12:43 pm
Re: Controller Xbox360
i have some code in AHK which move window at some position X,Y on the screen when i push Right on my keyboard
Right::
WinGetActiveTitle, Title1
WinMove, %Title1%,, 938, 10
then do you think it' s possible to do the same with Flowstone?
Cause have already link Right of 360xbox to send "Right" but its not read by AHK when both are open ( AHK & Flowstone)
Right::
WinGetActiveTitle, Title1
WinMove, %Title1%,, 938, 10
then do you think it' s possible to do the same with Flowstone?
Cause have already link Right of 360xbox to send "Right" but its not read by AHK when both are open ( AHK & Flowstone)
- Almeida
- Posts: 10
- Joined: Wed Jun 12, 2013 12:43 pm
Re: Controller Xbox360
It can be done with 2 other WinApi functions (GetActiveWindow and SetWindowPos). I'll have a look at this tomorrow, or maybe someone else is faster than me
-
MyCo - Posts: 718
- Joined: Tue Jul 13, 2010 12:33 pm
- Location: Germany
Re: Controller Xbox360
this is an example of code to define the size and position of the window.
- Code: Select all
require 'Win32API'
def event i
# winapi GetSystemMetrics
# http://msdn.microsoft.com/en-us/library/windows/desktop/ms724385(v=vs.85).aspx
# get current windows size
screen_width = Win32API.new("User32.dll","GetSystemMetrics",["L"],"L").call(0)
screen_height = Win32API.new("User32.dll","GetSystemMetrics",["L"],"L").call(1)
# winapi FindWindow
# http://msdn.microsoft.com/en-us/library/windows/desktop/ms633499(v=vs.85).aspx
findWindow = Win32API.new('user32', 'FindWindow', ['P','P'], 'L')
# define your windows name here
windows_name = 'FlowStone - [Schematic1*]'
hWnd = findWindow.call(0, windows_name)
# winapi SetWindowPos
# http://msdn.microsoft.com/en-us/library/windows/desktop/ms633545(v=vs.85).aspx
setWindowPos = Win32API.new("user32.dll", "SetWindowPos", ['I','I','I','I','I','I','I'], 'I')
# Struct SetWindowPos
# set windows size when moved (this is one of many options)
cx = 1024
cy = 768
posX = (screen_width/2)-(cx/2)
posY = (screen_height/2)-(cy/2)
# see uFlag option
# http://msdn.microsoft.com/en-us/library/windows/desktop/ms633545(v=vs.85).aspx
uFlags = 16384
#Call SetWindowPos
return_SetWindowPos = setWindowPos.call(hWnd, -2, posX, posY, cx, cy, uFlags)
watch 'hWnd', hWnd
watch 'returned value from SetWindowPos call (If the function succeeds, the return value is nonzero.)', return_SetWindowPos
end
-
digitalwhitebyte - Posts: 106
- Joined: Sat Jul 31, 2010 10:20 am
Re: Controller Xbox360
This code works fine when i use it in Flowstone but i would like to do this in the current window. I saw someone talk about enumwindows function (http://msdn.microsoft.com/en-us/library ... 85%29.aspx). I didn't find the way to implement it. Can u help me to do this?
- Almeida
- Posts: 10
- Joined: Wed Jun 12, 2013 12:43 pm
Re: Controller Xbox360
# define your windows name here
windows_name = 'FlowStone - [Schematic1*]'
in my code you have modify the red contents of this variable to match your app name windows
P.S.
EnumWindows work in conbination of EnumWindowsProc, the current Win32API not support callback.
windows_name = 'FlowStone - [Schematic1*]'
in my code you have modify the red contents of this variable to match your app name windows
P.S.
EnumWindows work in conbination of EnumWindowsProc, the current Win32API not support callback.
-
digitalwhitebyte - Posts: 106
- Joined: Sat Jul 31, 2010 10:20 am
16 posts
• Page 1 of 2 • 1, 2
Who is online
Users browsing this forum: Google [Bot] and 74 guests