1 | <html> |
---|
2 | <head> |
---|
3 | <title>Meta hotkeys cannot be captured on Firefox Mac</title> |
---|
4 | <script type="text/javascript"> |
---|
5 | window.onload = function() |
---|
6 | { |
---|
7 | var f = document.body.appendChild(document.createElement('iframe')); |
---|
8 | f.height = 700; |
---|
9 | f.width = 900; |
---|
10 | f.onload = function() |
---|
11 | { |
---|
12 | var doc = f.contentWindow.document; |
---|
13 | doc.body.innerHTML = '<p>Now these points of data make a beautiful line.<br>' |
---|
14 | + 'And we\'re out of beta.<br>' |
---|
15 | + 'We\'re releasing on time.<br>' |
---|
16 | + '</p><p>So I\'m GLaD. I got burned.<br>' |
---|
17 | + 'Think of all the things we learned<br>' |
---|
18 | + 'for the people who are still alive.</p>' |
---|
19 | doc.designMode = 'on'; |
---|
20 | doc.addEventListener('keydown', function(evt) |
---|
21 | { |
---|
22 | doc.execCommand('inserthtml', false, "<div>KeyCode = " + evt.keyCode + ", Ctrl/Meta = " + |
---|
23 | (evt.ctrlKey || evt.metaKey) + "</div>"); |
---|
24 | evt.preventDefault(); |
---|
25 | }, false); |
---|
26 | } |
---|
27 | f.src = 'about:blank'; |
---|
28 | } |
---|
29 | </script> |
---|
30 | </head> |
---|
31 | <body> |
---|
32 | <p>This test case is for Gecko and Safari only.</p> |
---|
33 | <p>Firefox: Try pressing the document mutating Ctrl or Meta hotkey combos inside the editing area - it will be intercepted on Firefox for Windows but not Firefox for Mac.</p> |
---|
34 | <p>Safari Mac: Try pressing Meta-B or Meta-I in the editing area - it cannot be intercepted by JavaScript.</p> |
---|
35 | <p>Some combo keys to try:</p> |
---|
36 | <ul> |
---|
37 | <li>Cut - Ctrl/Meta-X</li> |
---|
38 | <li>Paste - Ctrl/Meta-V</li> |
---|
39 | <li>Undo - Ctrl/Meta-Z</li> |
---|
40 | <li>Redo - Ctrl/Meta-Y</li> |
---|
41 | <li>Bold - Ctrl/Meta-B</li> |
---|
42 | <li>Italics - Ctrl/Meta-I</li> |
---|
43 | </ul> |
---|
44 | </body> |
---|
45 | </html> |
---|