Keyboard macros: Difference between revisions

m
→‎{{header|Ruby}}: expand example a bit
(add Ruby)
m (→‎{{header|Ruby}}: expand example a bit)
Line 294:
keypress do |key|
case key
when "\x18x04" # control-xd
delete_char
when :backspace
delete_previous_char
when "\x14" # control-t
transpose_chars
when :alt_t
transpose_words
when "\x18" # control-x
@ctrl_x = true
when "\x13" # control-s
if @ctrl_x
save_text
@ctrl_x = false
end
when "\x11" # control-q
exit if @ctrl_x
end
Anonymous user