robjs1000
07-05-2011, 07:25 PM
For interest and after plenty of research on finding suitable solutions, have found a method of converting mouse clicks into keyboard strokes.
Currently FMC's available within X-Plane (either X-Plane, X-FMC, UFMC) all have screen based input, i.e. LSK, RSK, and other CDU buttons all have to be pressed with a mouse click. For cockpit builders this is an obvious shortfall.
There is a ability to position the CDU to a certain screen position so that a CDU mask can be overlaid above this to show only the CDU screen. The rest of the mask is fitted with momentary button switches. The trick is now to capture mouse position & click as a keyboard stroke. Have found an opensource program called Glovepie that has the ability to do this. Then using the Opencockpits USBkeys board these keyboard strokes can then be emulated to physical buttons.
Sample Glovepie script - the cursor position is then tailored to whichever CDU key to emulate. ( http://glovepie.org/ )
// LSK1
If key.F1 then
mouse.CursorPosX = 25.2 cm
mouse.CursorPosY = 7 cm
mouse.LeftButton = True
mouse.LeftButton = False
endif
//LSK2
If key.F2 then
mouse.CursorPosX = 25.2 cm
mouse.CursorPosY = 7.6 cm
mouse.LeftButton = True
mouse.LeftButton = False
endif
I trust this will be useful
Rob
Currently FMC's available within X-Plane (either X-Plane, X-FMC, UFMC) all have screen based input, i.e. LSK, RSK, and other CDU buttons all have to be pressed with a mouse click. For cockpit builders this is an obvious shortfall.
There is a ability to position the CDU to a certain screen position so that a CDU mask can be overlaid above this to show only the CDU screen. The rest of the mask is fitted with momentary button switches. The trick is now to capture mouse position & click as a keyboard stroke. Have found an opensource program called Glovepie that has the ability to do this. Then using the Opencockpits USBkeys board these keyboard strokes can then be emulated to physical buttons.
Sample Glovepie script - the cursor position is then tailored to whichever CDU key to emulate. ( http://glovepie.org/ )
// LSK1
If key.F1 then
mouse.CursorPosX = 25.2 cm
mouse.CursorPosY = 7 cm
mouse.LeftButton = True
mouse.LeftButton = False
endif
//LSK2
If key.F2 then
mouse.CursorPosX = 25.2 cm
mouse.CursorPosY = 7.6 cm
mouse.LeftButton = True
mouse.LeftButton = False
endif
I trust this will be useful
Rob