Keyboard macros: Difference between revisions

→‎{{header|Java}}: Added a line so that application now closes automatically when X button pressed.
(Added Kotlin)
(→‎{{header|Java}}: Added a line so that application now closes automatically when X button pressed.)
Line 239:
frame.add( new JLabel(directions));
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.addKeyListener( new KeyAdapter(){
Line 254 ⟶ 255:
}
</lang>
 
=={{header|JavaScript}}==
The example below captures the F7 key when pressed, if the document (that is, the web page) has focus. If the function returns ''false'', the event processing is halted. If it returns any other value, including ''undefined'', the event continues up the DOM tree ('bubbling').
9,485

edits