NAME

JSON::Karabiner::Manipulator::Actions::From - From object definition

SYNOPSIS

  add_action 'from';

  # Use methods to add data to the action:
  add_key_code 'h';
  add_optional_modifiers 'control', 'left_shift';

DESCRIPTION

The from action describes the key and button presses that you want Karbiner to modify. For example, you may want Karbiner to do something when you hit Control-Shift-h.

Below are the methods used to add data to the from action. Consult the official Karbiner documentation about the from data structure.

METHODS

new $type

The constructor method is not called directly. The from action object is more typically created via the manipulator object's add_action method.

add_key_code $value

Add a key_code property to a from action:

  add_key_code 'h';

See official Karbiner documentation

add_any $value

Add an any property to a from action:

  add_any $value;

See official Karbiner documentation

add_consumer_key_code $value

Add an consumer_key_code property to a from action:

  add_consumer_key_code 'MUSIC_NEXT';

add_pointing_button $value

Add an pointing_button property to a from action:

  add_pointing_button 'button2';

add_optional_modifiers @values

Add an optional_modifiers property to keycodes in a from action:

  add_optional_modifiers 'control', 'shift', 'command';

See official Karbiner documentation

See official Karbiner documentation

add_mandatory_modifiers @values

Add an mandatory_modifiers property to keycodes in a from action:

  add_mandatory_modifiers 'shift', 'command';

See official Karbiner documentation

add_simulatneous [ $key_code_type = 'key_code' ], @values

Add an simultaneous property to a from action:

  add_simultaneous 'a', 'j';

An optional key_code_type can be passed in as the first argument:

  add_simulataneous 'pointing_button', 'button1', 'button2'

If no key_code_type value is detected, a default value of key_code is used.

See official Karbiner documentation

add_simulatneous_options [ $key_code_type = 'key_code' ], @values

Add an simultaneous property to a from action:

  add_simultaneous_options 'key_down_order', 'strict';

Multiple options by set my calling this method multiple times.

See official Karbiner documentation

VERSION

version 0.018

AUTHOR

Steve Dondley <s@dondley.com>

COPYRIGHT AND LICENSE

This software is copyright (c) 2020 by Steve Dondley.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.