OLD | NEW |
1 <body> | 1 <body> |
2 <style> | 2 <style> |
3 .blue { | 3 .blue { |
4 border: 2px solid blue; | 4 border: 2px solid blue; |
| 5 display: paragraph; |
5 } | 6 } |
6 </style> | 7 </style> |
7 <div class="blue" contenteditable></div> | 8 <div class="blue" contenteditable></div> |
8 <script> | 9 <script> |
9 import "../resources/event-sender.dart" as eventSender; | 10 import "../resources/event-sender.dart" as eventSender; |
10 import "dart:sky"; | 11 import "dart:sky"; |
11 import "package:mojo/services/input_events/public/interfaces/input_event_constan
ts.mojom.dart"; | 12 import "package:mojo/services/input_events/public/interfaces/input_event_constan
ts.mojom.dart"; |
12 import "package:mojo/services/input_events/public/interfaces/input_key_codes.moj
om.dart"; | 13 import "package:mojo/services/input_events/public/interfaces/input_key_codes.moj
om.dart"; |
13 | 14 |
14 void main() { | 15 void main() { |
15 var control = document.querySelector('.blue'); | 16 var control = document.querySelector('.blue'); |
16 control.focus(); | 17 control.focus(); |
17 eventSender.keyDown(KeyboardCode_A); | 18 eventSender.keyDown(KeyboardCode_A); |
18 eventSender.keyDown(KeyboardCode_B); | 19 eventSender.keyDown(KeyboardCode_B); |
19 eventSender.keyDown(KeyboardCode_C); | 20 eventSender.keyDown(KeyboardCode_C); |
20 eventSender.keyDown(KeyboardCode_D); | 21 eventSender.keyDown(KeyboardCode_D); |
21 eventSender.keyDown(KeyboardCode_E); | 22 eventSender.keyDown(KeyboardCode_E); |
22 eventSender.keyDown(KeyboardCode_LEFT, EventFlags_SHIFT_DOWN); | 23 eventSender.keyDown(KeyboardCode_LEFT, EventFlags_SHIFT_DOWN); |
23 eventSender.keyDown(KeyboardCode_LEFT, EventFlags_SHIFT_DOWN); | 24 eventSender.keyDown(KeyboardCode_LEFT, EventFlags_SHIFT_DOWN); |
24 eventSender.keyDown(KeyboardCode_LEFT, EventFlags_SHIFT_DOWN); | 25 eventSender.keyDown(KeyboardCode_LEFT, EventFlags_SHIFT_DOWN); |
25 eventSender.keyDown(KeyboardCode_BACK); | 26 eventSender.keyDown(KeyboardCode_BACK); |
26 eventSender.done(); | 27 eventSender.done(); |
27 } | 28 } |
28 </script> | 29 </script> |
29 </body> | 30 </body> |
OLD | NEW |