I ended up using Process Monitor as stated in this answer to detect what registry value was being modified while changing the setting. So to enable/disable the Automatically show the touch keyboard option the registry value you have to change: