Keyboard macros: Difference between revisions

Content added Content deleted
(Added Kotlin)
(→‎{{header|Java}}: Added a line so that application now closes automatically when X button pressed.)
Line 239: Line 239:
frame.add( new JLabel(directions));
frame.add( new JLabel(directions));
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.addKeyListener( new KeyAdapter(){
frame.addKeyListener( new KeyAdapter(){
Line 254: Line 255:
}
}
</lang>
</lang>

=={{header|JavaScript}}==
=={{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').
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').