Blame src/console/ptyc_console_vkcode.c

92a510
/*********************************************************/
92a510
/*  ptycon: a pty-console bridge                         */
92a510
/*  Copyright (C) 2016  Z. Gilboa                        */
92a510
/*  Released under GPLv2 and GPLv3; see COPYING.PTYCON.  */
92a510
/*********************************************************/
92a510
92a510
#include <psxtypes/psxtypes.h>
92a510
#include <ntcon/ntcon.h>
92a510
#include <ntcon/ntcon_vkcode.h>
92a510
92a510
#include <ptycon/ptycon.h>
92a510
#include "ptycon_bridge_impl.h"
92a510
92a510
#define P0()            {(const unsigned char[]){0},0}
92a510
#define P1(a)           {(const unsigned char[]){a,0},1}
92a510
#define P2(a,b)         {(const unsigned char[]){a,b,0},2}
92a510
#define P3(a,b,c)       {(const unsigned char[]){a,b,c,0},3}
92a510
#define P4(a,b,c,d)     {(const unsigned char[]){a,b,c,d,0},4}
92a510
#define P5(a,b,c,d,e)   {(const unsigned char[]){a,b,c,d,e,0},5}
92a510
#define P6(a,b,c,d,e,f) {(const unsigned char[]){a,b,c,d,e,f,0},6}
92a510
92a510
const struct ptyc_vkcode ptyc_vkcode[0x100] = {
92a510
	[VK_LBUTTON] =            P0(),
92a510
	[VK_RBUTTON] =            P0(),
92a510
	[VK_CANCEL] =             P0(),
92a510
	[VK_MBUTTON] =            P0(),
92a510
	[VK_XBUTTON1] =           P0(),
92a510
	[VK_XBUTTON2] =           P0(),
92a510
	[VK_BACK] =               P0(),
92a510
	[VK_TAB] =                P0(),
92a510
	[VK_CLEAR] =              P0(),
92a510
	[VK_RETURN] =             P0(),
92a510
	[VK_SHIFT] =              P0(),
92a510
	[VK_CONTROL] =            P0(),
92a510
	[VK_MENU] =               P0(),
92a510
	[VK_PAUSE] =              P0(),
92a510
	[VK_CAPITAL] =            P0(),
92a510
	[VK_HANGUL] =             P0(),
92a510
	[VK_JUNJA] =              P0(),
92a510
	[VK_FINAL] =              P0(),
92a510
	[VK_KANJI] =              P0(),
92a510
	[VK_ESCAPE] =             P0(),
92a510
	[VK_CONVERT] =            P0(),
92a510
	[VK_NONCONVERT] =         P0(),
92a510
	[VK_ACCEPT] =             P0(),
92a510
	[VK_MODECHANGE] =         P0(),
92a510
	[VK_SPACE] =              P0(),
92a510
	[VK_PRIOR] =              P0(),
92a510
	[VK_NEXT] =               P0(),
92a510
	[VK_END] =                P0(),
92a510
	[VK_HOME] =               P0(),
92a510
	[VK_LEFT] =               P3(0x1b,0x5b,0x44),
92a510
	[VK_UP] =                 P3(0x1b,0x5b,0x41),
92a510
	[VK_RIGHT] =              P3(0x1b,0x5b,0x43),
92a510
	[VK_DOWN] =               P3(0x1b,0x5b,0x42),
92a510
	[VK_SELECT] =             P0(),
92a510
	[VK_PRINT] =              P0(),
92a510
	[VK_EXECUTE] =            P0(),
92a510
	[VK_SNAPSHOT] =           P0(),
92a510
	[VK_INSERT] =             P0(),
92a510
	[VK_DELETE] =             P0(),
92a510
	[VK_HELP] =               P0(),
92a510
	[VK_LWIN] =               P0(),
92a510
	[VK_RWIN] =               P0(),
92a510
	[VK_APPS] =               P0(),
92a510
	[VK_SLEEP] =              P0(),
92a510
	[VK_NUMPAD0] =            P0(),
92a510
	[VK_NUMPAD1] =            P0(),
92a510
	[VK_NUMPAD2] =            P0(),
92a510
	[VK_NUMPAD3] =            P0(),
92a510
	[VK_NUMPAD4] =            P0(),
92a510
	[VK_NUMPAD5] =            P0(),
92a510
	[VK_NUMPAD6] =            P0(),
92a510
	[VK_NUMPAD7] =            P0(),
92a510
	[VK_NUMPAD8] =            P0(),
92a510
	[VK_NUMPAD9] =            P0(),
92a510
	[VK_MULTIPLY] =           P0(),
92a510
	[VK_ADD] =                P0(),
92a510
	[VK_SEPARATOR] =          P0(),
92a510
	[VK_SUBTRACT] =           P0(),
92a510
	[VK_DECIMAL] =            P0(),
92a510
	[VK_DIVIDE] =             P0(),
92a510
	[VK_F1] =                 P3(0x1b,0x4f,0x50),
92a510
	[VK_F2] =                 P3(0x1b,0x4f,0x51),
92a510
	[VK_F3] =                 P3(0x1b,0x4f,0x52),
92a510
	[VK_F4] =                 P3(0x1b,0x4f,0x53),
92a510
	[VK_F5] =                 P5(0x1b,0x5b,0x31,0x35,0x7e),
92a510
	[VK_F6] =                 P5(0x1b,0x5b,0x31,0x37,0x7e),
92a510
	[VK_F7] =                 P5(0x1b,0x5b,0x31,0x38,0x7e),
92a510
	[VK_F8] =                 P5(0x1b,0x5b,0x31,0x39,0x7e),
92a510
	[VK_F9] =                 P5(0x1b,0x5b,0x32,0x30,0x7e),
92a510
	[VK_F10] =                P5(0x1b,0x5b,0x32,0x31,0x7e),
92a510
	[VK_F11] =                P5(0x1b,0x5b,0x32,0x33,0x7e),
92a510
	[VK_F12] =                P5(0x1b,0x5b,0x32,0x34,0x7e),
92a510
	[VK_F13] =                P0(),
92a510
	[VK_F14] =                P0(),
92a510
	[VK_F15] =                P0(),
92a510
	[VK_F16] =                P0(),
92a510
	[VK_F17] =                P0(),
92a510
	[VK_F18] =                P0(),
92a510
	[VK_F19] =                P0(),
92a510
	[VK_F20] =                P0(),
92a510
	[VK_F21] =                P0(),
92a510
	[VK_F22] =                P0(),
92a510
	[VK_F23] =                P0(),
92a510
	[VK_F24] =                P0(),
92a510
	[VK_NUMLOCK] =            P0(),
92a510
	[VK_SCROLL] =             P0(),
92a510
	[VK_LSHIFT] =             P0(),
92a510
	[VK_RSHIFT] =             P0(),
92a510
	[VK_LCONTROL] =           P0(),
92a510
	[VK_RCONTROL] =           P0(),
92a510
	[VK_LMENU] =              P0(),
92a510
	[VK_RMENU] =              P0(),
92a510
	[VK_BROWSER_BACK] =       P0(),
92a510
	[VK_BROWSER_FORWARD] =    P0(),
92a510
	[VK_BROWSER_REFRESH] =    P0(),
92a510
	[VK_BROWSER_STOP] =       P0(),
92a510
	[VK_BROWSER_SEARCH] =     P0(),
92a510
	[VK_BROWSER_FAVORITES] =  P0(),
92a510
	[VK_BROWSER_HOME] =       P0(),
92a510
	[VK_VOLUME_MUTE] =        P0(),
92a510
	[VK_VOLUME_DOWN] =        P0(),
92a510
	[VK_VOLUME_UP] =          P0(),
92a510
	[VK_MEDIA_NEXT_TRACK] =   P0(),
92a510
	[VK_MEDIA_PREV_TRACK] =   P0(),
92a510
	[VK_MEDIA_STOP] =         P0(),
92a510
	[VK_MEDIA_PLAY_PAUSE] =   P0(),
92a510
	[VK_LAUNCH_MAIL] =        P0(),
92a510
	[VK_LAUNCH_MEDIA_SELECT] =P0(),
92a510
	[VK_LAUNCH_APP1] =        P0(),
92a510
	[VK_LAUNCH_APP2] =        P0(),
92a510
	[VK_OEM_1] =              P0(),
92a510
	[VK_OEM_PLUS] =           P0(),
92a510
	[VK_OEM_COMMA] =          P0(),
92a510
	[VK_OEM_MINUS] =          P0(),
92a510
	[VK_OEM_PERIOD] =         P0(),
92a510
	[VK_OEM_2] =              P0(),
92a510
	[VK_OEM_3] =              P0(),
92a510
	[VK_OEM_4] =              P0(),
92a510
	[VK_OEM_5] =              P0(),
92a510
	[VK_OEM_6] =              P0(),
92a510
	[VK_OEM_7] =              P0(),
92a510
	[VK_OEM_8] =              P0(),
92a510
	[VK_OEM_102] =            P0(),
92a510
	[VK_PROCESSKEY] =         P0(),
92a510
	[VK_PACKET] =             P0(),
92a510
	[VK_ATTN] =               P0(),
92a510
	[VK_CRSEL] =              P0(),
92a510
	[VK_EXSEL] =              P0(),
92a510
	[VK_EREOF] =              P0(),
92a510
	[VK_PLAY] =               P0(),
92a510
	[VK_ZOOM] =               P0(),
92a510
	[VK_NONAME] =             P0(),
92a510
	[VK_PA1] =                P0(),
92a510
	[VK_OEM_CLEAR] =          P0(),
92a510
};