Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The author is intentionally limiting this app to touch-only for touch-capable users. This breaks the game for anyone wanting to use a touchpad or mouse on their touchscreen laptop.

The offending code (from http://gameaboutsquares.com/game.c.js, beautified):

    (function($) {
        try {
            document.createEvent("TouchEvent");
            return;
        } catch (f) {}
        var eventMap = {
            mousedown : "touchstart",
            mouseup : "touchend",
            mousemove : "touchmove"
        };
        // mouse handling code follows
Never do this! Remove the entire try-catch block. There is absolutely no reason for you to be limiting touch-capable users to touch-only.


I use a touch-enabled laptop and come across this far too often. Even nytimes.com is guilty of this, as is Stripe Checkout.


We actually changed this recently in Stripe Checkout. Touch detection worked great for 99% of cases, but serving a touch-only experience to devices like yours was pretty clearly unacceptable.

We're now treating the touch-only versions as optimized for specific platforms. For example, we have a mobile version that is optimized for, and only displays on, Android and iOS. Going forward, we may explore a pointer event polyfill to improve support for less common touch devices.


I stand corrected. Thank you for finally making this change... It's been driving me mad.


Why are people doing this? There must be a reason.



It doesn't answer why they want to do this in the first place.


A lot of site have a design for mouse (hover states, pulldowns) and a design for touch (the hamburger) and they want to use only one or the other.


Touch and mouse are separate input devices and have separate set of expectations associated with them.


Further more it is completely unusable on some touch devices, I tried iPad 4 and iPhone 5. They both scroll the page (better: bump to the top, as if you wanted to scroll past the end of a page) instead of moving the blocks. :-/


No problem on Android Browser 4.4


I have a touchscreen laptop, and both touch and mouse work perfectly for me. Firefox 31 here.


Is it multitouch? Could it be that there is no TouchEvent and the touch screen acts as mouse?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: