-
Notifications
You must be signed in to change notification settings - Fork 54
Keyboard macro
HASUMI Hitoshi edited this page Sep 5, 2022
·
2 revisions
0.9.0+
Keyboard#macro
will type your keyboard on your behalf.
kbd.add_layer :default, %i(MACRO_1 MACRO_2)
kbd.define_mode_key :MACRO_1, [ Proc.new { kbd.macro("Hello") }, nil, 200, nil]
kbd.define_mode_key :MACRO_2, [ Proc.new { kbd.macro("World!") }, nil, 200, nil]
These macros add a line feed.
If you want it not to add a line feed, add an empty array []
at the second argument:
Proc.new { kbd.macro("Hello", []) }
The second argument accepts an array of the following symbols: :ENTER
:ESCAPE
:BSPACE
:TAB
:PGUP
:DELETE
:END
:PGDOWN
:RIGHT
:LEFT
:DOWN
and :UP
.
The default value of the second argument is [:ENTER]
.
This is the reason that a line feed is added when you don't pass any second argument.
- Getting started
- Keyboard features
- Keycodes (ja)
- Mouse (ja)
- Layers and mode key (ja)
- Debounce
- Composite key
- Split-type keyboard
- Keyscan matrix
- Num Lock, Caps Lock and Scroll Lock
- Useful methods that make you free
- BIOS mode
- Other features
- Examples
- Development
- Contribute to the Wiki
- FAQ