keybinder ~master

X11+GTK global keybindings


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:

libkeybinder bindings for D

libkeybinder is a GTK+ library for setting global keybindings. These are keybindings that apply across the whole desktop, even if the application is not in focus.

Get it

Add "keybinder": "~>0.1.0" to your dub.json.

Using with GTK+

libkeybinder is designed to work with GTK+:

import gtk.lotsOfStuff;
static import keybinder;

void main()
{
	auto app = new Application();
	app.addOnActivate(delegate void(GioApplication a)
	{
		keybinder.init();
		keybinder.bindGlobal("<Super>f", () {
			writeln("<Super>f was pressed");
		});
	});
}

Using without GTK+

Using this library without GTK+ (for instance, using DLangUI) requires a bit of extra work:

import std.stdio, core.thread, core.time;
static import keybinder;

void main()
{
	keybinder.initNoGTK();
	keybinder.bindGlobal("<Super>f", () {
		writeln("<Super>f was pressed");
	});
	while (true)
	{
		keybinder.poll();
		sleep(dur!"msecs"(50));
	}
}

This still requires GTK+, but you don't have to deal with it yourself.

However, if you're not using GTK+, why not use WebFreak001's XKeyBinD?

Authors:
  • dhasenan
Dependencies:
none
Versions:
0.1.0 2017-May-29
~master 2017-May-30
Show all 2 versions
Download Stats:
  • 0 downloads today

  • 0 downloads this week

  • 0 downloads this month

  • 19 downloads total

Score:
0.8
Short URL:
keybinder.dub.pm