It will either behave like Windows or Mac depending on what the native event model does. The event behavior depends on the specific platform. Var mac = /(Mac|iPhone|iPod|iPad)/i.test(atform) ĭocument.getElementById('close').classList. After the initial keydown event, only keypress events are sent until the keyup event occurs the inter-spaced keydown events are not sent. SetTimeout(test, 1000) //delay for demonstration use the close button on the right, you can just move the close button to the left when the user is on a MacLike O.S., otherwise isn't a problem if you put it on the most common side, the right. Out.innerHTML += '\nPlatform: ' + atform If (is_iPad) out.innerHTML += 'This is an iPad!' If (is_iPod) out.innerHTML += 'This is an iPod Touch!' If (is_iPhone) out.innerHTML += 'This is an iPhone!' If (is_iOS) out.innerHTML += 'You're using an iOS Device!\n' If (is_Mac) out.innerHTML += 'This is a Mac Computer!\n' If (!is_OSX) out.innerHTML += 'This NOT a Mac or an iOS Device!' Var out = document.getElementById('out') Var is_iOS = /(iPhone|iPod|iPad)/i.test(atform) Brackets is an open-source project, supported by an active and passionate community. Var is_OSX = /(Mac|iPhone|iPod|iPad)/i.test(atform)