Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,20 @@ ENABLE_PLUGIN_WITH_DEP(hotkey,
GDKX11,
gdk-x11-2.0)


test_hotkeyw32 () {
if test $HAVE_MSWINDOWS = yes ; then
have_hotkeyw32=yes
else
have_hotkeyw32=no
fi
}

ENABLE_PLUGIN_WITH_TEST(hotkeyw32,
Windows hotkeys plugin,
auto,
GENERAL)

ENABLE_PLUGIN_WITH_DEP(aosd,
X11 OSD,
auto,
Expand Down Expand Up @@ -834,6 +848,7 @@ if test "x$USE_GTK" = "xyes" ; then
echo " Status Icon: yes"
echo " X11 Global Hotkeys: $have_hotkey"
echo " X11 On-Screen Display (aosd): $have_aosd"
echo " Windows Global hotkeys: $have_hotkeyw32"
echo
fi

Expand Down
2 changes: 1 addition & 1 deletion src/hotkey/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
PLUGIN = hotkey${PLUGIN_SUFFIX}

SRCS = plugin.cc gui.cc grab.cc
SRCS = plugin.cc gui.cc grab.cc x_hotkey.cc hotkey_api_common.cc

include ../../buildsys.mk
include ../../extra.mk
Expand Down
88 changes: 88 additions & 0 deletions src/hotkey/api_hotkey.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
/*
* api_hotkey.h
* Audacious
*
* Copyright (C) 2005-2020 Audacious team
*
* XMMS - Cross-platform multimedia player
* Copyright (C) 1998-2003 Peter Alm, Mikael Alm, Olle Hallnas,
* Thomas Nilsson and 4Front Technologies
* Copyright (C) 1999-2003 Haavard Kvaalen
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; under version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses>.
*
* The Audacious team does not consider modular code linking to
* Audacious or using our public API to be a derived work.
*/

#ifndef _X_HOTKEY_H_INCLUDED
#define _X_HOTKEY_H_INCLUDED

#include <gtk/gtkstyle.h>
#include <utility>
#ifndef _WIN32
#include <X11/X.h>
#include <X11/XF86keysym.h>
#endif
#include "plugin.h"

class Hotkey
{

//#ifdef _WIN32
//#define OS_KeySym int
//#else
//#define OS_KeySym KeySym
//#endif

#ifdef _WIN32
typedef int OS_KeySym;
#else
typedef KeySym OS_KeySym;
#endif

public:
static void set_keytext(GtkWidget * entry, int key, int mask, int type);
static std::pair<int, int> get_is_mod(GdkEventKey * event);
template<typename T_GDK_EVENT>
static int calculate_mod(T_GDK_EVENT * event);
static void add_hotkey(HotkeyConfiguration ** pphotkey, OS_KeySym keysym,
int mask, int type, EVENT event);
static void key_to_string(int key, char ** out_keytext);
static char * create_human_readable_keytext(const char * const keytext,
int key, int mask);
};

#ifndef _WIN32
#define OS_KEY_AudioPrev XF86XK_AudioPrev
#define OS_KEY_AudioPlay XF86XK_AudioPlay
#define OS_KEY_AudioPause XF86XK_AudioPause
#define OS_KEY_AudioStop XF86XK_AudioStop
#define OS_KEY_AudioNext XF86XK_AudioNext
#define OS_KEY_AudioMute XF86XK_AudioMute
#define OS_KEY_AudioRaiseVolume XF86XK_AudioRaiseVolume
#define OS_KEY_AudioLowerVolume XF86XK_AudioLowerVolume
#else

#define OS_KEY_AudioPrev 0
#define OS_KEY_AudioPlay 0
#define OS_KEY_AudioPause 0
#define OS_KEY_AudioStop 0
#define OS_KEY_AudioNext 0
#define OS_KEY_AudioMute 0
#define OS_KEY_AudioRaiseVolume 0
#define OS_KEY_AudioLowerVolume 0

#endif

#endif //_X_HOTKEY_H_INCLUDED
4 changes: 2 additions & 2 deletions src/hotkey/grab.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
* This file is part of audacious-hotkey plugin for audacious
*
* Copyright (c) 2007 - 2008 Sascha Hlusiak <[email protected]>
* Name: grab.c
* Description: grab.c
* Name: grab.cc
* Description: grab.cc
*
* Part of this code is from itouch-ctrl plugin.
* Authors of itouch-ctrl are listed below:
Expand Down
27 changes: 27 additions & 0 deletions src/hotkey/grab.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,30 @@
/*
* grab.h
* Audacious
*
* Copyright (C) 2005-2020 Audacious team
*
* XMMS - Cross-platform multimedia player
* Copyright (C) 1998-2003 Peter Alm, Mikael Alm, Olle Hallnas,
* Thomas Nilsson and 4Front Technologies
* Copyright (C) 1999-2003 Haavard Kvaalen
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; under version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses>.
*
* The Audacious team does not consider modular code linking to
* Audacious or using our public API to be a derived work.
*/

#ifndef _GRAB_H_INCLUDED_
#define _GRAB_H_INCLUDED_

Expand Down
Loading