*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*/
#include "config.h"
#include <xorg-server.h>
#include "xf86.h"
#include "xf86Priv.h"
#include "xf86Xinput.h"
#include "xf86_OSproc.h"
#include <X11/XF86keysym.h>
#include <unistd.h>
#include <signal.h>
#include <errno.h>
#include <libsysevent.h>
#include <xkbsrv.h>
1,
"hotkey",
NULL,
NULL,
0
};
static struct {
const char *sub_class;
} sub_to_keysym_table [] = {
{ "ESC_acpiev_display_switch", XF86XK_Display },
{ "ESC_acpiev_sleep", XF86XK_Sleep },
{ "ESC_acpiev_screen_lock", XF86XK_ScreenSaver },
};
static void
{
int i;
char buf;
char *subclass;
break;
}
return;
}
static Bool
{
return FALSE;
}
#else
return FALSE;
}
if (!modMap) {
return FALSE;
}
#ifdef XKB
if (!noXkbExtension) {
} else
#endif
/* FIXME Our keymap here isn't exactly useful. */
#endif
return TRUE;
}
static void
hotkey_events_fini(void)
{
}
static Bool
if (hotkey_event_entry == NULL) {
"hotkey_events_init: sysevent_bind_handle failed: with errno = %d\n" , errno);
return FALSE;
}
else {
!= 0) {
return FALSE;
}
}
return TRUE;
}
static void
{
unsigned char buf;
int i;
else
#else
else
#endif
== keysym) {
keycode = i;
break;
}
}
if (!keycode)
else {
}
}
static int
{
char *s;
int blocked;
switch (what) {
case DEVICE_INIT:
return (!Success);
}
/*
* Block SIGIO so the new libsysevent/door threads created will
* mask SIGIO. See 6875743.
*/
blocked = xf86BlockSIGIO();
if (hotkey_events_init(device)) {
"hotkey_events_init: pipe open failed with errno %d\n", errno);
return (!Success);
} else {
}
} else {
return (!Success);
}
break;
case DEVICE_ON:
break;
break;
case DEVICE_CLOSE:
close(hotkey_event_fd[0]);
break;
case DEVICE_OFF:
break;
break;
}
return (Success);
}
static int
{
/* Initialize the InputInfoRec. */
return Success;
}
static void
{
xf86DeleteInput(pInfo, 0);
}
static void
{
}
static pointer
{
if (!Initialised)
Initialised = TRUE;
return module;
}
"hotkey",
1, 0, 0,
{0, 0, 0, 0} /* signature, to be patched into the file by */
/* a tool */
};
};