So I've read a handful of the threads on browser detection and feature detection, and I'm not exactly sure where what I need to do falls in the spectrum of that discussion.
I have a game site. People can play the game on a pc or a mobile device. They can also configure how they would like the game to work. For example, they can choose to play cards by single-clicking them or double-clicking them. However, double-clicking isn't an option option on mobile devices, so some people get stuck, because they pick that option and the javascript doesn't work.
So I thought, I'll let people specify one set of preferences for mobile devices, and another set of preferences for PCs, and only offer the options available on those devices. However, I'm reading that detecting a PC vs. a mobile device is a bad way to go.
So then, if I'm feature detecting, what exactly am I detecting? There's no way to detect if a device specifically supports a double-click, is there?
You will never be able to detect where it's a PC or Mobile device accessing your website efficiently, because there are soooo many devices and they change constantly. The only way to do it is by inspecting the browser agent string which is pretty tedious; there are thousands of it. Furthermore, it can be spoofed, so it's not a good source of information. The best you can do (which is what many professionals do, including me) is using feature-detection techniques - screen resolution, supported html tags, supported css properties, etc.
A good tool is Modenizr js library which is feature-based and you can check whether the device supports touch events, if it does, then you know that double-clicking will not be an option for you.
Here's a link to some documentation http://modernizr.com/docs/#features-misc