IS there a way to map mouse? - ED Forums
 


Notices

Reply
 
Thread Tools Display Modes
Old 12-05-2018, 11:09 PM   #1
Harlikwin
Member
 
Join Date: Nov 2018
Posts: 114
Default IS there a way to map mouse?

Is there a way to map the map the mouse functionality onto one of the front throttle switches? I don't recall the name but the one with the clicky middle button. I'd rather use that to flip switches than take my hand off the throttle.
__________________
i7 4720HQ ~3.5GHZ, +16GB DDR3 + Nvidia GTX980m (4GB VRAM) TM Warthog. TrackIR
Harlikwin is offline   Reply With Quote
Old 12-06-2018, 02:01 AM   #2
hansangb
Veteran
 
hansangb's Avatar
 
Join Date: May 2013
Location: New York
Posts: 3,457
Default

If you mean can you left and right click, then you can. Where you select the aircraft (on the left) go all the way down to UI Layer. It'll be in there.
__________________
hsb
HW Spec in Spoiler
---
Spoiler:
i7-8700K Delid/OC'ed to 5.1GHz, EVGA Z370 MB, 32GB DDR4 3200MHz, EVGA 2080 Ti FTW3, NVMe+SSD, Win 10 x64 Pro, MFG, JetSeat, Warthog, TM MFDs, Komodo Huey set, CV1
hansangb is offline   Reply With Quote
Old 12-06-2018, 05:24 PM   #3
Harlikwin
Member
 
Join Date: Nov 2018
Posts: 114
Default

Well, I mean instead of using the mouse entirely so using the collie hat (little mini-stick up on the front) to move the mouse cursor, and then clicking.
__________________
i7 4720HQ ~3.5GHZ, +16GB DDR3 + Nvidia GTX980m (4GB VRAM) TM Warthog. TrackIR
Harlikwin is offline   Reply With Quote
Old 12-07-2018, 01:49 AM   #4
SGT Coyle
Member
 
Join Date: Dec 2011
Posts: 411
Default

Are u using the TARGET Script Editor? If so the code below will make the mini stick operate the mouse. You will still need to assign Left, Right, Scroll up, and Scroll Down, from the UI_Layer to buttons on the Warthog.


Code:
MapAxis(&Throttle, SCX, MOUSE_X_AXIS, AXIS_NORMAL, MAP_RELATIVE);
SetSCurve(&Throttle, SCX, 0, 10, 0, 0, -4);
MapAxis(&Throttle, SCY, MOUSE_Y_AXIS, AXIS_REVERSED, MAP_RELATIVE);
 SetSCurve(&Throttle, SCY, 0, 10, 0, 0, -4);

The Button name is "SC". Hope that helps.
__________________
Implement CW and CCW keyboard commands for the encoders!!!!!
For all that is holy and right with the world please!
SGT Coyle is offline   Reply With Quote
Old 12-07-2018, 03:13 AM   #5
Harlikwin
Member
 
Join Date: Nov 2018
Posts: 114
Default

Actually im not using it, just straight up mapping the stick in dcs. If thats the only way ill look into mapping it that way tho.
__________________
i7 4720HQ ~3.5GHZ, +16GB DDR3 + Nvidia GTX980m (4GB VRAM) TM Warthog. TrackIR
Harlikwin is offline   Reply With Quote
Old 12-07-2018, 05:05 AM   #6
SGT Coyle
Member
 
Join Date: Dec 2011
Posts: 411
Default

There's no way that I'm aware of, to map a mouse axis in DCS.
__________________
Implement CW and CCW keyboard commands for the encoders!!!!!
For all that is holy and right with the world please!
SGT Coyle is offline   Reply With Quote
Old 12-07-2018, 02:47 PM   #7
Harlikwin
Member
 
Join Date: Nov 2018
Posts: 114
Default

Ok thanks.

Where do i put that file in target?
__________________
i7 4720HQ ~3.5GHZ, +16GB DDR3 + Nvidia GTX980m (4GB VRAM) TM Warthog. TrackIR
Harlikwin is offline   Reply With Quote
Old 12-07-2018, 05:12 PM   #8
SGT Coyle
Member
 
Join Date: Dec 2011
Posts: 411
Default

The code below is a TARGET .tmc file. It is a template I use to start all my scripts for my various Modules. It already has 90% of the code you need to create a fully functional script for Mod. All the TMWH buttons are scripted but not assigned. To assign a key, uncomment the appropriate line and enter your desired key, as described in the Editor Manual.
I've also put in handy generic copy and paste lines in easy to reach locations.
  1. Create a new file in TARGET SE
  2. Copy and Paste that into Editor window OVERWRITING what is there by default
  3. Save as a .tmc
  4. Compile and run
  5. In DCS controls setion you will have to map your Joystick, Throttles, and Friction Lever Axis's under "Thrusmaster Virtual Controller" column.
The Slew stick is mapped as mouse axis already. You will see it move in Windows. It is a bit sensitive. Check the Script Editor Manual on how to adjust it.

You will also need to assign buttons to Left and right mouse buttons, as well as Scroll Up/Down in the UI_Layer in DCS.

I hope this helps and welcome to Editor Scripting.

Spoiler:
Code:
include "target.tmh"
//program startup
int main()
{
    if(Init(&EventHandle)) return 1; // declare the event handler, return on error
    
    //add initialization code here
    
    Exclude(&HCougar);
    Exclude(&T16000);
    Exclude(&LMFD);
    Exclude(&RMFD);
    
    SetKBRate(22, 35);
    
    SetShiftButton(&Joystick, S4, 0, 0, 0);

//AXIS init        
    MapAxis(&Joystick, JOYX, DX_X_AXIS);
    MapAxis(&Joystick, JOYY, DX_Y_AXIS);
    
    //MapAxis(&Throttle, THR_LEFT, DX_ZROT_AXIS);
    MapAxis(&Throttle, THR_RIGHT, DX_Z_AXIS);
    
//*********Slew Stick acting as Mouse    
    MapAxis(&Throttle, SCX, MOUSE_X_AXIS, AXIS_NORMAL, MAP_RELATIVE);
        SetSCurve(&Throttle, SCX, 0, 10, 0, 0, -4);
    MapAxis(&Throttle, SCY, MOUSE_Y_AXIS, AXIS_REVERSED, MAP_RELATIVE);
        SetSCurve(&Throttle, SCY, 0, 10, 0, 0, -4);

//*********Slew Stick acting as independent AXIS.  NOT Mouse!!!  Used to setup control of A/C TDC        
//    MapAxis(&Throttle, SCX, DX_XROT_AXIS, AXIS_NORMAL, MAP_ABSOLUTE);
//        SetSCurve(&Throttle, SCX, 0, 10, 0, 0, -4);
//    MapAxis(&Throttle, SCY, DX_YROT_AXIS, AXIS_REVERSED, MAP_ABSOLUTE);
//        SetSCurve(&Throttle, SCY, 0, 10, 0, 0, -4);
    //TDC Slew Control on Throttle Mini Stick    
    //KeyAxis(&Throttle, SCX, 0, AXMAP2(3,Throttle_Designator_Controller_Left,0,Throttle_Designator_Controller_Right));
    //KeyAxis(&Throttle, SCY, 0, AXMAP2(3,Throttle_Designator_Controller_Down,0,Throttle_Designator_Controller_Up));    
        
    MapAxis(&Throttle, THR_FC, DX_SLIDER_AXIS);    
    
// Init Lights  Programing light below
    ActKey(PULSE+KEYON+LED(&Throttle, LED_INTENSITY, 10)); //set Throttle backlight power to middle // set Throttle backlight power to low
    ActKey(PULSE+KEYON+LED(&Throttle, LED_ONOFF, LED_CURRENT+LED1)); //set LED 1 On
    ActKey(PULSE+KEYON+LED(&Throttle, LED_ONOFF, LED_CURRENT-LED2)); //set LED 2 OFF
    ActKey(PULSE+KEYON+LED(&Throttle, LED_ONOFF, LED_CURRENT+LED3)); //set LED 3 On
    ActKey(PULSE+KEYON+LED(&Throttle, LED_ONOFF, LED_CURRENT-LED4)); //set LED 4 OFF
    ActKey(PULSE+KEYON+LED(&Throttle, LED_ONOFF, LED_CURRENT+LED5)); //set LED 5 On
// Flags...    
    
//////////////////////////////////////////////////////////////////////    
//BUTTON PROGRAMING STARTS BELOW
//////////////////////////////////////////////////////////////////

//STICK PROGRAMING

//MapKey(&Joystick,);
//MapKeyIO(&Joystick,,);

//MapKeyIOUMD(&Throttle,,
//                            ,
//                            ,
//                            ,
//                            ,
//                            ,
//                            );
//Trigger
//MapKey(&Joystick,TG1,);
//MapKey(&Joystick,TG2,);

//Buttons
//MapKey(&Joystick,S1,);
//MapKey(&Joystick,S2,);
//MapKeyI&Joystick,S3,);
//MapKey(&Joystick,S4,);

//DMS
//MapKey(&Joystick,H3U,);
//MapKey(&Joystick,H3D,);
//MapKey(&Joystick,H3R,);
//MapKey(&Joystick,H3L,);

//TMS
//MapKey(&Joystick,H2U,);
//MapKey(&Joystick,H2D,);
//MapKey(&Joystick,H2R,);
//MapKey(&Joystick,H2L,);

//CMS
//MapKey(&Joystick,H4U,);
//MapKey(&Joystick,H4D,);
//MapKey(&Joystick,H4R,);
//MapKey(&Joystick,H4L,);

//MapKey(&Joystick,H4P,);


//Trim
//MapKeyIO(&Joystick,H1U,);
//MapKeyIO(&Joystick,H1D,);
//MapKeyIO(&Joystick,H1R,);
//MapKeyIO(&Joystick,H1L,);
    
//THROTTLE PROGRAMING

//MapKey(&Throttle,,);
//MapKeyIO(&Throttle,,,);

//MapKeyIOUMD(&Throttle,,
//                            ,
//                            ,
//                            ,
//                            ,
//                            ,
//                            );
//Coolie Hat
//MapKey(&Throttle,CSD,);
//MapKey(&Throttle,CSU,);
//MapKey(&Throttle,CSR,);
//MapKey(&Throttle,CSL,);

//Slew
//MapKey(&Throttle,,Slew_DWN);//Set to operate in AXIS Section
//MapKey(&Throttle,,Slew_UP);//Set to operate in AXIS Section
//MapKey(&Throttle,,Slew_RT);//Set to operate in AXIS Section
//MapKey(&Throttle,,Slew_LT);//Set to operate in AXIS Section

//MapKey(&Throttle,SC,);


//Left Throttle Button
//MapKey(&Throttle,LTB, );

//Pinky Switch
//MapKey(&Throttle,PSF,Pinky_FWD);
//MapKey(&Throttle,PSM,Pinky_MID);
//MapKey(&Throttle,PSB,Pinky_AFT);

//MIC Switch
//MapKey(&Throttle,MSR,);
//MapKey(&Throttle,MSL,);
//MapKey(&Throttle,MSU,);
//MapKey(&Throttle,MSD,);

//MapKey(&Throttle,MSP,);

//Speed Brake
//MapKeyIO(&Throttle,SPDF,;
//MapKeyIO(&Throttle,SPDM,);
//MapKeyIO(&Throttle,SPDB,);

//Boat Switch
//MapKey(&Throttle,BSF,);
//MapKey(&Throttle,BSM,);
//MapKey(&Throttle,BSB,);

//China Hat
//MapKey(&Throttle,CHF,);
//MapKey(&Throttle,CHM,);
//MapKey(&Throttle,CHB,), );

//THROTTLE Base PROGRAMING
//MapKey(&Throttle,,);
//MapKeyIO(&Throttle,,,);

//MapKeyIOUMD(&Throttle,,
//                            ,
//                            ,
//                            ,
//                            ,
//                            ,
//                            );

//Engine Fuel Flow LT/RT
//MapKey(&Throttle,EFLNORM,);
//MapKey(&Throttle,EFLOVER,);
//MapKey(&Throttle,EFRNORM,);
//MapKey(&Throttle,EFROVER,);

//Engine Operator LT/RT
//MapKey(&Throttle,EOLIGN,);
//MapKey(&Throttle,EOLNORM,);
//MapKey(&Throttle,EOLMOTOR,);

//MapKey(&Throttle,EORIGN,);
//MapKey(&Throttle,EORNORM,);
//MapKey(&Throttle,EORMOTOR,);

//Throttle Friction Control
//Set to operate in AXIS Section

//APU Switch
//MapKey(&Throttle,APUON,);
//MapKey(&Throttle,APUOFF,);

//Landing Gear Button
//MapKey(&Throttle,LDGH, );

//Autopilot Select Switch
//MapKey(&Throttle,APPAT,);
//MapKey(&Throttle,APAH,);
//MapKey(&Throttle,APALT,);


//Autopilot Engage/Diengage Button
//MapKey(&Throttle,APENG,);

//Radar Altimeter Mode
//MapKey(&Throttle,RDRNRM,);
//MapKey(&Throttle,RDRDIS,);

//EAC On/Off
//MapKey(&Throttle,EACON,);
//MapKey(&Throttle,EACOFF,);

//Flap
//MapKey(&Throttle,FLAPU,);
//MapKey(&Throttle,FLAPM,);                                
//MapKey(&Throttle,FLAPD,);

//Throttle Idle Cutoff
//MapKey(&Throttle,IDLEROFF,);    
//MapKey(&Throttle,IDLERON,);

//MapKey(&Throttle,IDLELOFF,);
//MapKey(&Throttle,IDLELON,);
    
    
}

//event handler
int EventHandle(int type, alias o, int x)
{
    DefaultMapping(&o, x);
    
    //add event handling code here
}
__________________
Implement CW and CCW keyboard commands for the encoders!!!!!
For all that is holy and right with the world please!
SGT Coyle is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT. The time now is 08:07 PM. vBulletin Skin by ForumMonkeys. Powered by vBulletin®.
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.