54 } |
54 } |
55 } |
55 } |
56 } |
56 } |
57 |
57 |
58 if ( isWin8 ) { |
58 if ( isWin8 ) { |
59 // Windows 8+ emoji can be "typed" with the onscreen keyboard. |
59 /* |
60 // That triggers the normal keyboard events, but not the 'input' event. |
60 * Windows 8+ emoji can be "typed" with the onscreen keyboard. |
61 // Thankfully it sets keyCode 231 when the onscreen keyboard inserts any emoji. |
61 * That triggers the normal keyboard events, but not the 'input' event. |
|
62 * Thankfully it sets keyCode 231 when the onscreen keyboard inserts any emoji. |
|
63 */ |
62 editor.on( 'keyup', function( event ) { |
64 editor.on( 'keyup', function( event ) { |
63 if ( event.keyCode === 231 ) { |
65 if ( event.keyCode === 231 ) { |
64 parseNode( editor.selection.getNode() ); |
66 parseNode( editor.selection.getNode() ); |
65 } |
67 } |
66 } ); |
68 } ); |
67 } else if ( ! isWin ) { |
69 } else if ( ! isWin ) { |
68 // In MacOS inserting emoji doesn't trigger the stanradr keyboard events. |
70 /* |
69 // Thankfully it triggers the 'input' event. |
71 * In MacOS inserting emoji doesn't trigger the stanradr keyboard events. |
70 // This works in Android and iOS as well. |
72 * Thankfully it triggers the 'input' event. |
|
73 * This works in Android and iOS as well. |
|
74 */ |
71 editor.on( 'keydown keyup', function( event ) { |
75 editor.on( 'keydown keyup', function( event ) { |
72 typing = ( event.type === 'keydown' ); |
76 typing = ( event.type === 'keydown' ); |
73 } ); |
77 } ); |
74 |
78 |
75 editor.on( 'input', function() { |
79 editor.on( 'input', function() { |