mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-01-31 05:00:35 +00:00
Add a bunch more keys to the X11 clients.
Now, QF does something reasonable for every key on my keyboar for which X gives us a keycode.
This commit is contained in:
parent
4115ef5dd3
commit
858d95de58
3 changed files with 123 additions and 0 deletions
|
@ -315,6 +315,28 @@ typedef enum {
|
|||
QFK_ZEN_KOHO, /* Multiple/All Candidate(s) */
|
||||
QFK_MAE_KOHO, /* Previous Candidate */
|
||||
|
||||
/* some multi-media/browser keys */
|
||||
QFK_HOMEPAGE,
|
||||
QFK_SEARCH,
|
||||
QFK_MAIL,
|
||||
QFK_FAVORITES,
|
||||
QFK_AUDIOMUTE,
|
||||
QFK_AUDIOLOWERVOLUME,
|
||||
QFK_AUDIORAISEVOLUME,
|
||||
QFK_AUDIOPLAY,
|
||||
QFK_CALCULATOR,
|
||||
QFK_REDO,
|
||||
QFK_NEW,
|
||||
QFK_RELOAD,
|
||||
QFK_OPEN,
|
||||
QFK_CLOSE,
|
||||
QFK_REPLY,
|
||||
QFK_MAILFORWARD,
|
||||
QFK_SEND,
|
||||
QFK_SAVE,
|
||||
QFK_BACK,
|
||||
QFK_FORWARD,
|
||||
|
||||
/* Add any other keys here */
|
||||
|
||||
//
|
||||
|
|
|
@ -51,6 +51,8 @@ static __attribute__ ((used)) const char rcsid[] =
|
|||
#include <stdlib.h>
|
||||
#include <X11/Xlib.h>
|
||||
#include <X11/keysym.h>
|
||||
#include <X11/XF86keysym.h>
|
||||
#include <X11/Sunkeysym.h>
|
||||
#include <X11/Xutil.h>
|
||||
#include <X11/Xatom.h>
|
||||
|
||||
|
@ -507,6 +509,83 @@ XLateKey (XKeyEvent * ev, int *k, int *u)
|
|||
case XK_Mae_Koho:
|
||||
key = QFK_MAE_KOHO;
|
||||
break;
|
||||
case XF86XK_HomePage:
|
||||
key = QFK_HOMEPAGE;
|
||||
break;
|
||||
case XF86XK_Search:
|
||||
key = QFK_SEARCH;
|
||||
break;
|
||||
case XF86XK_Mail:
|
||||
key = QFK_MAIL;
|
||||
break;
|
||||
case XF86XK_Favorites:
|
||||
key = QFK_FAVORITES;
|
||||
break;
|
||||
case XF86XK_AudioMute:
|
||||
key = QFK_AUDIOMUTE;
|
||||
break;
|
||||
case XF86XK_AudioLowerVolume:
|
||||
key = QFK_AUDIOLOWERVOLUME;
|
||||
break;
|
||||
case XF86XK_AudioRaiseVolume:
|
||||
key = QFK_AUDIORAISEVOLUME;
|
||||
break;
|
||||
case XF86XK_AudioPlay:
|
||||
key = QFK_AUDIOPLAY;
|
||||
break;
|
||||
case XF86XK_Calculator:
|
||||
key = QFK_CALCULATOR;
|
||||
break;
|
||||
case XK_Help:
|
||||
key = QFK_HELP;
|
||||
break;
|
||||
case XK_Undo:
|
||||
key = QFK_UNDO;
|
||||
break;
|
||||
case XK_Redo:
|
||||
key = QFK_REDO;
|
||||
break;
|
||||
case XF86XK_New:
|
||||
key = QFK_NEW;
|
||||
break;
|
||||
case XF86XK_Reload: // eh? it's open (hiraku) on my kb
|
||||
key = QFK_RELOAD;
|
||||
break;
|
||||
case SunXK_Open:
|
||||
//FALL THROUGH
|
||||
case XF86XK_Open:
|
||||
key = QFK_OPEN;
|
||||
break;
|
||||
case XF86XK_Close:
|
||||
key = QFK_CLOSE;
|
||||
break;
|
||||
case XF86XK_Reply:
|
||||
key = QFK_REPLY;
|
||||
break;
|
||||
case XF86XK_MailForward:
|
||||
key = QFK_MAILFORWARD;
|
||||
break;
|
||||
case XF86XK_Send:
|
||||
key = QFK_SEND;
|
||||
break;
|
||||
case XF86XK_Save:
|
||||
key = QFK_SAVE;
|
||||
break;
|
||||
case XK_KP_Equal:
|
||||
key = QFK_KP_EQUALS;
|
||||
break;
|
||||
case XK_parenleft:
|
||||
key = QFK_LEFTPAREN;
|
||||
break;
|
||||
case XK_parenright:
|
||||
key = QFK_RIGHTPAREN;
|
||||
break;
|
||||
case XF86XK_Back:
|
||||
key = QFK_BACK;
|
||||
break;
|
||||
case XF86XK_Forward:
|
||||
key = QFK_FORWARD;
|
||||
break;
|
||||
|
||||
default:
|
||||
if (keysym < 128) { // ASCII keys
|
||||
|
|
|
@ -366,6 +366,28 @@ keyname_t keynames[] = {
|
|||
{ "K_ZEN_KOHO", QFK_ZEN_KOHO },
|
||||
{ "K_MAE_KOHO", QFK_MAE_KOHO },
|
||||
|
||||
{ "K_HOMEPAGE", QFK_HOMEPAGE },
|
||||
{ "K_SEARCH", QFK_SEARCH },
|
||||
{ "K_MAIL", QFK_MAIL },
|
||||
{ "K_FAVORITES", QFK_FAVORITES },
|
||||
{ "K_AUDIOMUTE", QFK_AUDIOMUTE },
|
||||
{ "K_AUDIOLOWERVOLUME", QFK_AUDIOLOWERVOLUME },
|
||||
{ "K_AUDIORAISEVOLUME", QFK_AUDIORAISEVOLUME },
|
||||
{ "K_AUDIOPLAY", QFK_AUDIOPLAY },
|
||||
{ "K_CALCULATOR", QFK_CALCULATOR },
|
||||
{ "K_UNDO", QFK_UNDO },
|
||||
{ "K_REDO", QFK_REDO },
|
||||
{ "K_NEW", QFK_NEW },
|
||||
{ "K_RELOAD", QFK_RELOAD },
|
||||
{ "K_OPEN", QFK_OPEN },
|
||||
{ "K_CLOSE", QFK_CLOSE },
|
||||
{ "K_REPLY", QFK_REPLY },
|
||||
{ "K_MAILFORWARD", QFK_MAILFORWARD },
|
||||
{ "K_SEND", QFK_SEND },
|
||||
{ "K_SAVE", QFK_SAVE },
|
||||
{ "K_BACK", QFK_BACK },
|
||||
{ "K_FORWARD", QFK_FORWARD },
|
||||
|
||||
{ "M_BUTTON1", QFM_BUTTON1 },
|
||||
{ "M_BUTTON2", QFM_BUTTON2 },
|
||||
{ "M_BUTTON3", QFM_BUTTON3 },
|
||||
|
|
Loading…
Reference in a new issue