Windows 10 using 10.8.4 driver, System tray, doesn't have option to disable LED

Questions and answers about 3Dconnexion devices on Windows.

Moderator: Moderators

Horizons
Posts: 2
Joined: Tue Feb 15, 2022 1:32 pm

Re: Windows 10 using 10.8.4 driver, System tray, doesn't have option to disable LED

Post by Horizons »

Hello All!
Is it possible to disable light of joystick (i already changed my cfg an it is work) and still leave the led on the 'lock' button on?) That's will be really nice!
jwick
Moderator
Moderator
Posts: 3331
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Re: Windows 10 using 10.8.4 driver, System tray, doesn't have option to disable LED

Post by jwick »

Which device?
Horizons
Posts: 2
Joined: Tue Feb 15, 2022 1:32 pm

Re: Windows 10 using 10.8.4 driver, System tray, doesn't have option to disable LED

Post by Horizons »

jwick wrote: Wed Feb 16, 2022 12:36 amWhich device?
Space Mouse Enterprise
jwick
Moderator
Moderator
Posts: 3331
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Re: Windows 10 using 10.8.4 driver, System tray, doesn't have option to disable LED

Post by jwick »

Horizons wrote: Wed Feb 16, 2022 2:06 pm
jwick wrote: Wed Feb 16, 2022 12:36 amWhich device?
Space Mouse Enterprise
True. There is no option to turn off some LEDs and not others. This is the first I've heard the request. I like the idea though.
mhoopes
Posts: 137
Joined: Thu Dec 07, 2006 10:48 am
Location: Campbell, CA

Re: Windows 10 using 10.8.4 driver, System tray, doesn't have option to disable LED

Post by mhoopes »

I got tired of directly editing Global.xml and wrote a couple of simple batch files that use fart.exe (https://sourceforge.net/projects/fart-it/). I mapped the "toggle" file as an application to a keyboard button in Logitech Options.

3DxLEDinitialize.bat: This one just adds <LEDsEnabled>true</LEDsEnabled> to %appdata%\3Dconnexion\3DxWare\Cfg\Global.xml, if <LEDsEnabled> is not present in Global.xml. I have an extra label :initialize that would be handy if I combined the two batch files, though the combination didn't function properly.

Code: Select all

REM This batch script requires fart.exe to be in the same folder,
REM or in one specified in one of the Path Environment Variables.
REM If the <LEDsEnabled> tags aren't present, they will be added
REM directly after <Settings>, with the default = true.
set Global_cfg=%appdata%\3Dconnexion\3DxWare\Cfg\Global.xml
findstr "<LEDsEnabled>" "%Global_cfg%"
if not errorlevel 1 goto initialize else goto:eof
:initalize
start fart "%Global_cfg%" "<Settings>" "<Settings><LEDsEnabled>true</LEDsEnabled>"
3Dx_LEDs_toggle.bat: This toggles the LED state. It's not 100% reliable, but good enough for occasional use. If anyone has some suggested mods to make it more consistent, those would be appreciated.

Code: Select all

REM This batch script requires fart.exe to be in the same folder,
REM or in one specified in one of the Path Environment Variables.
set Global_cfg=%appdata%\3Dconnexion\3DxWare\Cfg\Global.xml
findstr "<LEDsEnabled>true" "%Global_cfg%"
if not errorlevel 1 goto disable
start fart "%Global_cfg%" "<LEDsEnabled>false" "<LEDsEnabled>true" 
:disable
start fart "%Global_cfg%" "<LEDsEnabled>true" "<LEDsEnabled>false"
Michael Hoopes
mhoopes
Posts: 137
Joined: Thu Dec 07, 2006 10:48 am
Location: Campbell, CA

Re: Windows 10 using 10.8.4 driver, System tray, doesn't have option to disable LED

Post by mhoopes »

I don't know how to edit a published post, so I'm re-posting here. I forgot to add back in a goto:eof in the toggle batch file.

I got tired of directly editing Global.xml and wrote a couple of simple batch files that use fart.exe (https://sourceforge.net/projects/fart-it/). I mapped the "toggle" file as an application to a keyboard button in Logitech Options.

3DxLEDinitialize.bat: This one just adds <LEDsEnabled>true</LEDsEnabled> to %appdata%\3Dconnexion\3DxWare\Cfg\Global.xml, if <LEDsEnabled> is not present in Global.xml. I have an extra label :initialize that would be handy if I combined the two batch files, though the combination didn't function properly.

Code: Select all

REM This batch script requires fart.exe to be in the same folder,
REM or in one specified in one of the Path Environment Variables.
REM If the <LEDsEnabled> tags aren't present, they will be added
REM directly after <Settings>, with the default = true.
set Global_cfg=%appdata%\3Dconnexion\3DxWare\Cfg\Global.xml
findstr "<LEDsEnabled>" "%Global_cfg%"
if not errorlevel 1 goto initialize else goto:eof
:initalize
start fart "%Global_cfg%" "<Settings>" "<Settings><LEDsEnabled>true</LEDsEnabled>"
3Dx_LEDs_toggle.bat: This toggles the LED state. It's not 100% reliable, but good enough for occasional use. If anyone has some suggested mods to make it more consistent, those would be appreciated.

Code: Select all

REM This batch script requires fart.exe to be in the same folder,
REM or in one specified in one of the Path Environment Variables.
set Global_cfg=%appdata%\3Dconnexion\3DxWare\Cfg\Global.xml
findstr "<LEDsEnabled>true" "%Global_cfg%"
if not errorlevel 1 goto disable
start fart "%Global_cfg%" "<LEDsEnabled>false" "<LEDsEnabled>true" 
goto:eof
:disable
start fart "%Global_cfg%" "<LEDsEnabled>true" "<LEDsEnabled>false"
Michael Hoopes
jwick
Moderator
Moderator
Posts: 3331
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Re: Windows 10 using 10.8.4 driver, System tray, doesn't have option to disable LED

Post by jwick »

mhoopes,

Sure that will work. The file rules. If you change it, by whatever means, it will be used.
I could have given you a script to do it...
mhoopes
Posts: 137
Joined: Thu Dec 07, 2006 10:48 am
Location: Campbell, CA

Re: Windows 10 using 10.8.4 driver, System tray, doesn't have option to disable LED

Post by mhoopes »

jwick wrote: Fri Feb 25, 2022 9:47 am mhoopes,

Sure that will work. The file rules. If you change it, by whatever means, it will be used.
I could have given you a script to do it...
Dang, I forgot to ask. Next time. 8)
https://youtu.be/dnYITopZ9gA
Michael Hoopes
AndreLoco
Posts: 4
Joined: Fri Feb 04, 2022 4:10 pm

Re: Windows 10 using 10.8.4 driver, System tray, doesn't have option to disable LED

Post by AndreLoco »

Thanks @patrick for clear instruction! Everything works as charm.

I wrote simple python script which can create entry in XML file or toggle it. It can be launched with macro or anything.

Code: Select all

import os
import xml.etree.ElementTree as ET

appdata_path = os.getenv('APPDATA')
global_xml_path = "\\3Dconnexion\\3DxWare\\Cfg\\Global.xml"

if not os.path.exists(appdata_path + global_xml_path):
	print("File not found at: " + appdata_path + global_xml_path)
	exit(-1)

global_xml = ET.parse(appdata_path + global_xml_path)
root = global_xml.getroot()
settings = root.find('Settings')
if settings is None:
	print("Can't find 'Setting' section")
	exit(-2)
LED_setting_name = "LEDsEnabled"
found_element = False
for elem in settings.iter(LED_setting_name):
	if found_element:
		print("Multiple entrance detected!")
		exit(-3)
	found_element = True
	if elem.text.lower() in ['true']:
		elem.text = 'False'
	else:
		elem.text = 'True'

if found_element:
	global_xml.write(appdata_path + global_xml_path)
else:
	led_setting = ET.Element(LED_setting_name)
	led_setting.text = "False"
	settings = root.find('Settings')
	settings.append(led_setting)
	global_xml.write(appdata_path + global_xml_path)
mhoopes
Posts: 137
Joined: Thu Dec 07, 2006 10:48 am
Location: Campbell, CA

Re: Windows 10 using 10.8.4 driver, System tray, doesn't have option to disable LED

Post by mhoopes »

Andre- your script works well, thanks much! Note for others who want to try it - you'll need to install the Python interpreter.

I updated my cmd/fart batch script to combine the "initialize" function and make the toggle function more reliable, and xml-case-insensitive to be compatible with Andre's script.

Code: Select all

@echo off
title 3Dx_LEDs_toggle
:: This batch script requires fart.exe to be in the same folder,
:: or in one specified in one of the Path Environment Variables.
set Global_cfg=%appdata%\3Dconnexion\3DxWare\Cfg\Global.xml
findstr /i "<LEDsEnabled>" "%Global_cfg%" >nul || (
    echo intialized
    fart -aiq "%Global_cfg%" "</Settings>" "<LEDsEnabled>False</LEDsEnabled></Settings>"
)
findstr /i "<LEDsEnabled>True" "%Global_cfg%" >nul && (
    echo disabled
    fart -aiq "%Global_cfg%" "<LEDsEnabled>True" "<LEDsEnabled>False"
    goto :eof
)
    echo enabled
    fart -aiq "%Global_cfg%" "<LEDsEnabled>False" "<LEDsEnabled>True"
Michael Hoopes
jwick
Moderator
Moderator
Posts: 3331
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Re: Windows 10 using 10.8.4 driver, System tray, doesn't have option to disable LED

Post by jwick »

An "LEDs Active" CheckBox was added to the latest GUI (Device->Advanced Settings page).
AndreLoco
Posts: 4
Joined: Fri Feb 04, 2022 4:10 pm

Re: Windows 10 using 10.8.4 driver, System tray, doesn't have option to disable LED

Post by AndreLoco »

AndreLoco wrote: Sun Mar 20, 2022 9:24 am Thanks @patrick for clear instruction! Everything works as charm.

I wrote simple python script which can create entry in XML file or toggle it. It can be launched with macro or anything.

Code: Select all

import os
import xml.etree.ElementTree as ET

appdata_path = os.getenv('APPDATA')
global_xml_path = "\\3Dconnexion\\3DxWare\\Cfg\\Global.xml"

if not os.path.exists(appdata_path + global_xml_path):
	print("File not found at: " + appdata_path + global_xml_path)
	exit(-1)

global_xml = ET.parse(appdata_path + global_xml_path)
root = global_xml.getroot()
settings = root.find('Settings')
if settings is None:
	print("Can't find 'Setting' section")
	exit(-2)
LED_setting_name = "LEDsEnabled"
found_element = False
for elem in settings.iter(LED_setting_name):
	if found_element:
		print("Multiple entrance detected!")
		exit(-3)
	found_element = True
	if elem.text.lower() in ['true']:
		elem.text = 'False'
	else:
		elem.text = 'True'

if found_element:
	global_xml.write(appdata_path + global_xml_path)
else:
	led_setting = ET.Element(LED_setting_name)
	led_setting.text = "False"
	settings = root.find('Settings')
	settings.append(led_setting)
	global_xml.write(appdata_path + global_xml_path)
Small update to how execute script:
1. You need to install Python3 (Thanks mhoopes - I forgot it isn't preinstalled :wink: )
2. Save script to preferred location with extension "*.py" (i.e. "SME_toogle_LED.py") - IMPORTANT indentation in script are very important!
3. You can test run your script by double-clicking on it. If everything works go to next point.
4. Best way for me to launch script from SME directly is to assign Application to button - add new one, where you point created earlier script.

@jwick - unfortunately I can't locate this feature you mentioned:
Image
jwick
Moderator
Moderator
Posts: 3331
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Re: Windows 10 using 10.8.4 driver, System tray, doesn't have option to disable LED

Post by jwick »

AndreLoco,

What version do you have installed? There was a new release a few days ago.
AndreLoco
Posts: 4
Joined: Fri Feb 04, 2022 4:10 pm

Re: Windows 10 using 10.8.4 driver, System tray, doesn't have option to disable LED

Post by AndreLoco »

jwick,

I see it now. I had 10.8.5 and must to manually check update. Now with 10.8.6 I had it in Advance settings.

Anyway, I think assigning it to a button is pretty convenient 8)
mhoopes
Posts: 137
Joined: Thu Dec 07, 2006 10:48 am
Location: Campbell, CA

Re: Windows 10 using 10.8.4 driver, System tray, doesn't have option to disable LED

Post by mhoopes »

Update to Windows CLI/fart method. With 3DConnexion's Advanced Settings update, Global.xml is now indented, and one line of code is inserted or deleted to toggle the LED:
<LEDsEnabled>false</LEDsEnabled>

Code: Select all

@echo off
title 3Dx_LEDs_toggle
:: This batch script requires fart.exe to be in the same folder,
:: or in one specified in one of the Path Environment Variables.
set Global_Cfg=%appdata%\3Dconnexion\3DxWare\Cfg\Global.xml
findstr /i /C:"<LEDsEnabled>false</LEDsEnabled>" "%Global_Cfg%" >nul && (
    fart -C --remove "%Global_Cfg%" "    <LEDsEnabled>false</LEDsEnabled>\r\n"
    set errorlevel=0
) || (
    fart -C "%Global_Cfg%" "  </Settings>" "    <LEDsEnabled>false</LEDsEnabled>"\r\n"  </Settings>"
)
Michael Hoopes
Post Reply