pnmixer
Volume mixer for the system tray
Data Structures | Functions
hotkeys.c File Reference

Hotkeys subsystem. More...

#include <gdk/gdkx.h>
#include <X11/XKBlib.h>
#include "audio.h"
#include "prefs.h"
#include "support-intl.h"
#include "support-log.h"
#include "hotkey.h"
#include "hotkeys.h"
#include "main.h"
Include dependency graph for hotkeys.c:

Go to the source code of this file.

Data Structures

struct  hotkeys
 

Functions

static void hotkeys_remove_filter (GdkFilterFunc filter, gpointer data)
 
static void hotkeys_add_filter (GdkFilterFunc filter, gpointer data)
 
static GdkFilterReturn key_filter (GdkXEvent *gdk_xevent, G_GNUC_UNUSED GdkEvent *event, gpointer data)
 
void hotkeys_reload (Hotkeys *hotkeys)
 
void hotkeys_unbind (Hotkeys *hotkeys)
 
void hotkeys_bind (Hotkeys *hotkeys)
 
void hotkeys_free (Hotkeys *hotkeys)
 
Hotkeys * hotkeys_new (Audio *audio)
 

Detailed Description

Hotkeys subsystem.

This file handles the hotkeys subsystem, including communication with Xlib and intercepting key presses before they can be interpreted by Gtk/Gdk.

Definition in file hotkeys.c.

Function Documentation

◆ hotkeys_add_filter()

static void hotkeys_add_filter ( GdkFilterFunc  filter,
gpointer  data 
)
static

Definition at line 55 of file hotkeys.c.

◆ hotkeys_bind()

void hotkeys_bind ( Hotkeys *  hotkeys)

Bind hotkeys manually. Should be paired with a hotkeys_unbind() call.

Parameters
hotkeysa Hotkeys instance.

Definition at line 210 of file hotkeys.c.

◆ hotkeys_free()

void hotkeys_free ( Hotkeys *  hotkeys)

Cleanup the hotkey subsystem.

Parameters
hotkeysa Hotkeys instance.

Definition at line 228 of file hotkeys.c.

◆ hotkeys_new()

Hotkeys* hotkeys_new ( Audio *  audio)

Creates the hotkeys subsystem, and bind the hotkeys.

Parameters
audiothe audio system, needed to control the audio.
Returns
the newly created Hotkeys instance.

Definition at line 250 of file hotkeys.c.

◆ hotkeys_reload()

void hotkeys_reload ( Hotkeys *  hotkeys)

Reload hotkey preferences. This has to be called each time the preferences are modified.

Parameters
hotkeysa Hotkeys instance.

Definition at line 121 of file hotkeys.c.

◆ hotkeys_remove_filter()

static void hotkeys_remove_filter ( GdkFilterFunc  filter,
gpointer  data 
)
static

Definition at line 41 of file hotkeys.c.

◆ hotkeys_unbind()

void hotkeys_unbind ( Hotkeys *  hotkeys)

Unbind hotkeys manually. Should be paired with a hotkeys_bind() call.

Parameters
hotkeysa Hotkeys instance.

Definition at line 192 of file hotkeys.c.

◆ key_filter()

static GdkFilterReturn key_filter ( GdkXEvent *  gdk_xevent,
G_GNUC_UNUSED GdkEvent *  event,
gpointer  data 
)
static

This function is called before Gtk/Gdk can respond to any(!) window event and handles pressed hotkeys.

Parameters
gdk_xeventthe native event to filter
eventthe GDK event to which the X event will be translated
datauser data set when the filter was installed
Returns
a GdkFilterReturn value, should be GDK_FILTER_CONTINUE only

Definition at line 86 of file hotkeys.c.