Lock those Mouse Buttons!

I got really tired of having my mouse buttons swap on me at random times. I’m running Windows 10 on two separate laptops, an X1 and a Yoga and I see the same issue on both of them. After not using the machine overnight, or sometimes from one hour to the next, I’ll simply find that my mouse buttons have been swapped for no apparent reason. Searching the web, I see reports of this going as far back as 2015 and apparently no one seems to be able to fix this.

Until now. So far, this is working for me. It’s a little program which runs invisibly in the background. It doesn’t eliminate the problem but it brute-forces fixes it. If it senses that the buttons have been swapped, it will swap them back within seconds. Put this in your Windows Startup folder to launch automatically. So far this is working beautifully, eliminating this annoyance for me and I hope you will find this to be helpful as well!

using System;
using System.Configuration;
using Microsoft.Win32;
using System.Threading;
using System.Runtime.InteropServices;

namespace ButtonLocker
{
    static class Program
    {
        [DllImport("user32.dll")]
        public static extern Int32 SwapMouseButton(Int32 bSwap);

        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        static void Main()
        {
            int swapVal = Convert.ToInt32(ConfigurationManager.AppSettings.Get("swapVal"));
            int sleepMS = Convert.ToInt32(ConfigurationManager.AppSettings.Get("sleepMS"));

            while (!false)
            {
                try
                {
                    SwapMouseButton(swapVal);

                    var key = Registry.CurrentUser.CreateSubKey("Control Panel\\Mouse\\");
                    int? currSetting = Convert.ToInt32(key.GetValue("SwapMouseButtons"));

                    if (currSetting == null || currSetting != swapVal)
                    {
                        key.SetValue("SwapMouseButtons", swapVal, RegistryValueKind.String);
                    }

                    Thread.Sleep(sleepMS);
                }
                catch { }
            }
        }
    }
}

Here’s the configuration file. Adjust according to your needs.

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <startup> 
        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
    </startup>
  <appSettings>
    <add key="swapVal" value="0"/>
    <add key="sleepMS" value="3000"/>
  </appSettings>
</configuration>

Permission to Fail

We all experience failure from time to time. We might fall short of our expectations or even fail outright upon occasion. What defines our overall success is not the absence of failure, but rather - how we react to failure and our success-to-failure ratio over time.

When we delegate responsibility, we are empowering others within our organizations to act in our stead. By definition, this means we are empowering them to succeed for us over the long run, but also to fail from time to time. (Just as we would.)

Some managers think that they are delegating effectively; they allow their subordinates latitude and autonomy to work independently, but in actuality they are only delegating the right to succeed. The true mark of effective delegation is what happens after results fall short of expectations? Can subordinates look forward to a collaborative and matter-of-fact discussion on the topic of 'how do we move on from here', or will they cringe at the prospect of recrimination and rebuke?

It might seem counter-intuitive, but I predict a greater degree of long-term success in an environment where delegation not only confers freedom to succeed, but also - permission to fail.

What do you think?

Transitions...

Thanks to all the wonderful folks at Apex Global Solutions! It has been great working together with you - we have truly built something great together and I firmly believe that your best days are ahead of you. I'm happy to continue working part time to help our team through the transition over the coming weeks.

At the same time, I am excited to begin my new project at ConnectiveRx. The folks at ConnectiveRx have a track record of impressive achievements and I am looking forward to working together with such talented individuals.

Here's to change. It comes at you - embrace it!

Reflections...

Let's compare notes. Often, the best way to learn, even from our own experiences, is to bounce our experiences and ideas off of a friend and see what reflects back.

A great sage once remarked: “I have learned much from my teachers, more from my colleagues, and most of all from my students” (R. Chanina, Ta’anis 7a).

As I share my experiences and ideas in this space, I look forward to hearing the same from you!