frnsys / half_earth

Half-Earth Socialism: The Game, for Half-Earth Socialism (Verso 2022)
GNU Affero General Public License v3.0
41 stars 7 forks source link

Support swiping for devices that are both touch and click #173

Closed frnsys closed 2 years ago

frnsys commented 2 years ago

Right now we change swiping behavior depending on if its a mobile/touch device or a click device. But the problem is that devices can be both (e.g. a microsoft surface). I think we can approach this by detecting what "mode" the device is in. If we detect a click, then we start treating it as a click device, if we detect a touch, then we start treating it as a touch device. The only problem with this approach (perhaps there's a way around it) is that the first click/touch that switches the mode will "eat" that input.

frnsys commented 2 years ago

So I just bind both touch and click draggable events, which I believe is all that was necessary for this.