xkeybin-d ~master

Interface for global keyboard shortcuts on X11


To use this package, run the following command in your project's root directory:

Manual usage
Put the following dependency into your project's dependences section:

XKeyBinD

Interface for global keyboard shortcuts on X11 in D applications.

Usage

import xkeybind;

void main() {
    XKeyBind.load(); // Opens a X11 display and initializes virtual modifier locations
    // Alternatively also usable with a Modifier and an integer keycode
    XKeyBind.bind("Ctrl-Shift-X", (mod, key) { // Binds a key from a string (see notation below) with a handler
        writeln("Pressed!");
        XKeyBind.unbind("Ctrl-Shift-X"); // Unbinds all handlers from a key
    });

    while (true) {
        // Handle window events

        XKeyBind.update(); // Handles X11 key press events and calls handlers
    }
}

String key notation

(Modifiers-)Key

Any number of modifiers combined with hyphens and a key at the end.

Valid modifiers:

  • shift
  • control
  • ctrl
  • alt, altl
  • altgr, altr
  • super, superl
  • superr
  • hyper, hyperl
  • hyperr
  • meta, metal
  • metar

Keys are parsed using XStringToKeysym

Authors:
  • webfreak
Dependencies:
x11
Versions:
1.0.0 2016-Jan-02
~master 2016-Jan-02
Show all 2 versions
Download Stats:
  • 0 downloads today

  • 0 downloads this week

  • 0 downloads this month

  • 63 downloads total

Score:
0.3
Short URL:
xkeybin-d.dub.pm