What would be the best solution to detect if the user is on a device with keyboard with arrow and esc keys, or is on a mobile device with touch functionality - like swipe?
I have a image gallery which I would like to display either arrow keys if they are on a device with a keyboard.
Or, if they are on a mobile device, I would like to tell them to swipe left or right.
Here's my gallery : http://kiledesign.no/?side=Foto&vis=Galleri
I have modified the core code for the gallery plugin (jQuery Gridder) so the user can use the arrow keys left/up for previous image, and right/down for next image.
I have also included esc-key to close the full view.
In addition, I have added jquery mobile swipe left (prev)/right (next).
Now I would like to find a way to determen which tips to present based on what device.
I thought about css media query
. Like min-width
.
But there is mini-computers with quite small screens, and there's tablet, or even phones with quite high resoultions...
So I don't think it's a fool-proof solution...
Any suggestion?