Module: awful.button

Create easily new buttons objects ignoring certain modifiers.

Info:

  • Copyright: 2018 Emmanuel Lepage Vallee,2009 Julien Danjou
  • Originally authored by: Julien Danjou <julien@danjou.info>,Emmanuel Lepage Vallee <elv1313@gmail.com>
    (Full contributors list available on our github project)

Constructors

awful.button (mod, button, press, release) Create a new button to use as binding.
awful.button {[args]} Create a new button to use as binding.

Object properties

modifiers N/A The table of modifier keys.
button integer The mouse button identifier.
description string The button description.
name string The button name.
group string The button group.
on_press function The callback when this button is pressed.
on_release function The callback when this button is released.

Object methods

:trigger () Execute this mousebinding.

Tables

ignore_modifiers Modifiers to ignore.
names The mouse buttons names.


Constructors

awful.button (mod, button, press, release)
Create a new button to use as binding.

Parameters:

  • mod table A list of modifier keys. Valid modifiers are: Any, Mod1, Mod2, Mod3, Mod4, Mod5, Shift, Lock and Control`. This argument is (mandatory).
  • button number The mouse button (it is recommended to use the awful.button.names constants.
  • press function Callback for when the button is pressed.
  • release function Callback for when the button is released.

Returns:

    table An awful.button object.
awful.button {[args]}
Create a new button to use as binding.

Parameters:

  • args
    • modifiers table A list of modifier keys. Valid modifiers are: Any, Mod1, Mod2, Mod3, Mod4, Mod5, Shift, Lock and Control`. This argument is (mandatory).
    • button number The mouse button (it is recommended to use the awful.button.names constants.
    • on_press function Callback for when the button is pressed.
    • on_release function Callback for when the button is released.

Returns:

    table An awful.button object.

Object properties

modifiers N/A
The table of modifier keys.

A modifier, such as Control are a predetermined set of keys that can be used to implement keybindings. Note that this list is fix and cannot be extended using random key names, code or characters.

Common modifiers are:

Name Description
Mod1Usually called Alt on PCs and Option on Macs
Mod4Also called Super, Windows and Command ⌘
Mod5Also called AltGr or ISO Level 3
ShiftBoth left and right shift keys
ControlAlso called CTRL on some keyboards

Please note that Awesome ignores the status of "Lock" and "Mod2" (Num Lock).

button integer
The mouse button identifier.

Mouse buttons

description string
The button description.
name string
The button name.
group string
The button group.
on_press function
The callback when this button is pressed.
on_release function
The callback when this button is released.

Object methods

:trigger ()
Execute this mousebinding.

Tables

ignore_modifiers
Modifiers to ignore.

By default this is initialized as { "Lock", "Mod2" } so the Caps Lock or Num Lock modifier are not taking into account by awesome when pressing keys.

Fields:

  • Lock
  • Mod2
names
The mouse buttons names.

It can be used instead of the button ids.

Fields:

  • LEFT The left mouse button.
  • MIDDLE The scrollwheel button.
  • RIGHT The context menu button.
  • SCROLL_UP A scroll up increment.
  • SCROLL_DOWN A scroll down increment.
generated by LDoc 1.4.6 Last updated 2021-11-13 00:35:50