receiver: add USB consumer codes
This commit is contained in:
parent
e3788f3d1f
commit
3d87f418cf
|
@ -19,8 +19,8 @@
|
|||
# Reprogrammable keys information
|
||||
# Mostly from Logitech documentation, but with some edits for better Lunix compatability
|
||||
|
||||
from .common import NamedInt as _NamedInt
|
||||
from .common import NamedInts as _NamedInts
|
||||
from .common import UnsortedNamedInts as _UnsortedNamedInts
|
||||
|
||||
# <controls.xml awk -F\" '/<Control /{sub(/^LD_FINFO_(CTRLID_)?/, "", $2);printf("\t%s=0x%04X,\n", $2, $4)}' | sort -t= -k2
|
||||
CONTROL = _NamedInts(
|
||||
|
@ -611,7 +611,7 @@ ACTIONID = _NamedInts(
|
|||
Ydisp=0x04,
|
||||
Vscroll=0x05,
|
||||
Hscroll=0x06,
|
||||
Control=0x07,
|
||||
Consumer=0x07,
|
||||
Internal=0x08,
|
||||
Power=0x09
|
||||
)
|
||||
|
@ -627,8 +627,6 @@ MOUSE_BUTTONS._fallback = lambda x: 'unknown:%02X' % x
|
|||
|
||||
# HID USB Keycodes from https://www.usb.org/sites/default/files/documents/hut1_12v2.pdf
|
||||
USB_HID_KEYCODES = _NamedInts(
|
||||
NONE=0x00,
|
||||
ERR_OVF=0x01,
|
||||
A=0x04,
|
||||
B=0x05,
|
||||
C=0x06,
|
||||
|
@ -807,13 +805,388 @@ modifiers = {
|
|||
0x4: 'Alt+',
|
||||
0x8: 'Meta+',
|
||||
0x3: 'Cntrl+Shift+',
|
||||
0x5: 'Cntrl+Alt+',
|
||||
0x9: 'Cntrl+Meta+',
|
||||
0x6: 'Shift+Alt+',
|
||||
0xA: 'Shift+Meta+',
|
||||
0xC: 'Alt+Meta+'
|
||||
0x5: 'Alt+Cntrl+',
|
||||
0x9: 'Meta+Cntrl+',
|
||||
0x6: 'Alt+Shift+',
|
||||
0xA: 'Meta+Shift+',
|
||||
0xC: 'Meta+Alt+'
|
||||
}
|
||||
KEYS = []
|
||||
KEYS_Default = 0x7FFFFFFF # Special value to reset key to default - has to be different from all others
|
||||
KEYS = _UnsortedNamedInts()
|
||||
KEYS[KEYS_Default] = 'Default' # Value to reset to default
|
||||
KEYS[0] = 'None' # Value for no output
|
||||
for val, name in modifiers.items():
|
||||
for key in USB_HID_KEYCODES:
|
||||
KEYS.append(_NamedInt((int(key) << 8) + val, name + str(key)))
|
||||
KEYS[0x01000000 + (int(key) << 8) + val] = name + str(key)
|
||||
|
||||
HID_CONSUMERCODES = _NamedInts(
|
||||
Unassigned=0x00,
|
||||
Consumer_Control=0x01,
|
||||
Numeric_Key_Pad=0x02,
|
||||
Programmable_Buttons=0x03,
|
||||
Microphone=0x04,
|
||||
Headphone=0x05,
|
||||
Graphic_Equalizer=0x06,
|
||||
AM__PM=0x22,
|
||||
Power=0x30,
|
||||
Reset=0x31,
|
||||
Sleep=0x32,
|
||||
Sleep_After=0x33,
|
||||
Sleep_Mode=0x34,
|
||||
Illumination=0x35,
|
||||
Function_Buttons=0x36,
|
||||
Menu=0x40,
|
||||
Menu__Pick=0x41,
|
||||
Menu_Up=0x42,
|
||||
Menu_Down=0x43,
|
||||
Menu_Left=0x44,
|
||||
Menu_Right=0x45,
|
||||
Menu_Escape=0x46,
|
||||
Menu_Value_Increase=0x47,
|
||||
Menu_Value_Decrease=0x48,
|
||||
Data_On_Screen=0x60,
|
||||
Closed_Caption=0x61,
|
||||
Closed_Caption_Select=0x62,
|
||||
VCR__TV=0x63,
|
||||
Broadcast_Mode=0x64,
|
||||
Snapshot=0x65,
|
||||
Still=0x66,
|
||||
Selection=0x80,
|
||||
Assign_Selection=0x81,
|
||||
Mode_Step=0x82,
|
||||
Recall_Last=0x83,
|
||||
Enter_Channel=0x84,
|
||||
Order_Movie=0x85,
|
||||
Channel=0x86,
|
||||
Media_Selection=0x87,
|
||||
Media_Select_Computer=0x88,
|
||||
Media_Select_TV=0x89,
|
||||
Media_Select_WWW=0x8A,
|
||||
Media_Select_DVD=0x8B,
|
||||
Media_Select_Telephone=0x8C,
|
||||
Media_Select_Program_Guide=0x8D,
|
||||
Media_Select_Video_Phone=0x8E,
|
||||
Media_Select_Games=0x8F,
|
||||
Media_Select_Messages=0x90,
|
||||
Media_Select_CD=0x91,
|
||||
Media_Select_VCR=0x92,
|
||||
Media_Select_Tuner=0x93,
|
||||
Quit=0x94,
|
||||
Help=0x95,
|
||||
Media_Select_Tape=0x96,
|
||||
Media_Select_Cable=0x97,
|
||||
Media_Select_Satellite=0x98,
|
||||
Media_Select_Security=0x99,
|
||||
Media_Select_Home=0x9A,
|
||||
Media_Select_Call=0x9B,
|
||||
Channel_Increment=0x9C,
|
||||
Channel_Decrement=0x9D,
|
||||
Media_Select_SAP=0x9E,
|
||||
VCR_Plus=0xA0,
|
||||
Once=0xA1,
|
||||
Daily=0xA2,
|
||||
Weekly=0xA3,
|
||||
Monthly=0xA4,
|
||||
Play=0xB0,
|
||||
Pause=0xB1,
|
||||
Record=0xB2,
|
||||
Fast_Forward=0xB3,
|
||||
Rewind=0xB4,
|
||||
Scan_Next_Track=0xB5,
|
||||
Scan_Previous_Track=0xB6,
|
||||
Stop=0xB7,
|
||||
Eject=0xB8,
|
||||
Random_Play=0xB9,
|
||||
Select_DisC=0xBA,
|
||||
Enter_Disc=0xBB,
|
||||
Repeat=0xBC,
|
||||
Tracking=0xBD,
|
||||
Track_Normal=0xBE,
|
||||
Slow_Tracking=0xBF,
|
||||
Frame_Forward=0xC0,
|
||||
Frame_Back=0xC1,
|
||||
Mark=0xC2,
|
||||
Clear_Mark=0xC3,
|
||||
Repeat_From_Mark=0xC4,
|
||||
Return_To_Mark=0xC5,
|
||||
Search_Mark_Forward=0xC6,
|
||||
Search_Mark_Backwards=0xC7,
|
||||
Counter_Reset=0xC8,
|
||||
Show_Counter=0xC9,
|
||||
Tracking_Increment=0xCA,
|
||||
Tracking_Decrement=0xCB,
|
||||
Stop__Eject=0xCC,
|
||||
Play__Pause=0xCD,
|
||||
Play__Skip=0xCE,
|
||||
Volume=0xE0,
|
||||
Balance=0xE1,
|
||||
Mute=0xE2,
|
||||
Bass=0xE3,
|
||||
Treble=0xE4,
|
||||
Bass_Boost=0xE5,
|
||||
Surround_Mode=0xE6,
|
||||
Loudness=0xE7,
|
||||
MPX=0xE8,
|
||||
Volume_Up=0xE9,
|
||||
Volume_Down=0xEA,
|
||||
Speed_Select=0xF0,
|
||||
Playback_Speed=0xF1,
|
||||
Standard_Play=0xF2,
|
||||
Long_Play=0xF3,
|
||||
Extended_Play=0xF4,
|
||||
Slow=0xF5,
|
||||
Fan_Enable=0x100,
|
||||
Fan_Speed=0x101,
|
||||
Light=0x102,
|
||||
Light_Illumination_Level=0x103,
|
||||
Climate_Control_Enable=0x104,
|
||||
Room_Temperature=0x105,
|
||||
Security_Enable=0x106,
|
||||
Fire_Alarm=0x107,
|
||||
Police_Alarm=0x108,
|
||||
Proximity=0x109,
|
||||
Motion=0x10A,
|
||||
Duress_Alarm=0x10B,
|
||||
Holdup_Alarm=0x10C,
|
||||
Medical_Alarm=0x10D,
|
||||
Balance_Right=0x150,
|
||||
Balance_Left=0x151,
|
||||
Bass_Increment=0x152,
|
||||
Bass_Decrement=0x153,
|
||||
Treble_Increment=0x154,
|
||||
Treble_Decrement=0x155,
|
||||
Speaker_System=0x160,
|
||||
Channel_Left=0x161,
|
||||
Channel_Right=0x162,
|
||||
Channel_Center=0x163,
|
||||
Channel_Front=0x164,
|
||||
Channel_Center_Front=0x165,
|
||||
Channel_Side=0x166,
|
||||
Channel_Surround=0x167,
|
||||
Channel_Low_Frequency_Enhancement=0x168,
|
||||
Channel_Top=0x169,
|
||||
Channel_Unknown=0x16A,
|
||||
Subchannel=0x170,
|
||||
Subchannel_Increment=0x171,
|
||||
Subchannel_Decrement=0x172,
|
||||
Alternate_Audio_Increment=0x173,
|
||||
Alternate_Audio_Decrement=0x174,
|
||||
Application_Launch_Buttons=0x180,
|
||||
AL_Launch_Button_Configuration_Tool=0x181,
|
||||
AL_Programmable_Button_Configuration=0x182,
|
||||
AL_Consumer_Control_Configuration=0x183,
|
||||
AL_Word_Processor=0x184,
|
||||
AL_Text_Editor=0x185,
|
||||
AL_Spreadsheet=0x186,
|
||||
AL_Graphics_Editor=0x187,
|
||||
AL_Presentation_App=0x188,
|
||||
AL_Database_App=0x189,
|
||||
AL_Email_Reader=0x18A,
|
||||
AL_Newsreader=0x18B,
|
||||
AL_Voicemail=0x18C,
|
||||
AL_Contacts__Address_Book=0x18D,
|
||||
AL_Calendar__Schedule=0x18E,
|
||||
AL_Task__Project_Manager=0x18F,
|
||||
AL_Log__Journal__Timecard=0x190,
|
||||
AL_Checkbook__Finance=0x191,
|
||||
AL_Calculator=0x192,
|
||||
AL_A__V_Capture__Playback=0x193,
|
||||
AL_Local_Machine_Browser=0x194,
|
||||
AL_LAN__WAN_Browser=0x195,
|
||||
AL_Internet_Browser=0x196,
|
||||
AL_Remote_Networking__ISP_Connect=0x197,
|
||||
AL_Network_Conference=0x198,
|
||||
AL_Network_Chat=0x199,
|
||||
AL_Telephony__Dialer=0x19A,
|
||||
AL_Logon=0x19B,
|
||||
AL_Logoff=0x19C,
|
||||
AL_Logon__Logoff=0x19D,
|
||||
AL_Terminal_Lock__Screensaver=0x19E,
|
||||
AL_Control_Panel=0x19F,
|
||||
AL_Command_Line_Processor__Run=0x1A0,
|
||||
AL_Process__Task_Manager=0x1A1,
|
||||
AL_Select_Tast__Application=0x1A2,
|
||||
AL_Next_Task__Application=0x1A3,
|
||||
AL_Previous_Task__Application=0x1A4,
|
||||
AL_Preemptive_Halt_Task__Application=0x1A5,
|
||||
AL_Integrated_Help_Center=0x1A6,
|
||||
AL_Documents=0x1A7,
|
||||
AL_Thesaurus=0x1A8,
|
||||
AL_Dictionary=0x1A9,
|
||||
AL_Desktop=0x1AA,
|
||||
AL_Spell_Check=0x1AB,
|
||||
AL_Grammar_Check=0x1AC,
|
||||
AL_Wireless_Status=0x1AD,
|
||||
AL_Keyboard_Layout=0x1AE,
|
||||
AL_Virus_Protection=0x1AF,
|
||||
AL_Encryption=0x1B0,
|
||||
AL_Screen_Saver=0x1B1,
|
||||
AL_Alarms=0x1B2,
|
||||
AL_Clock=0x1B3,
|
||||
AL_File_Browser=0x1B4,
|
||||
AL_Power_Status=0x1B5,
|
||||
AL_Image_Browser=0x1B6,
|
||||
AL_Audio_Browser=0x1B7,
|
||||
AL_Movie_Browser=0x1B8,
|
||||
AL_Digital_Rights_Manager=0x1B9,
|
||||
AL_Digital_Wallet=0x1BA,
|
||||
AL_Instant_Messaging=0x1BC,
|
||||
AL_OEM_Features___Tips__Tutorial_Browser=0x1BD,
|
||||
AL_OEM_Help=0x1BE,
|
||||
AL_Online_Community=0x1BF,
|
||||
AL_Entertainment_Content_Browser=0x1C0,
|
||||
AL_Online_Shopping_Browser=0x1C1,
|
||||
AL_SmartCard_Information__Help=0x1C2,
|
||||
AL_Market_Monitor__Finance_Browser=0x1C3,
|
||||
AL_Customized_Corporate_News_Browser=0x1C4,
|
||||
AL_Online_Activity_Browser=0x1C5,
|
||||
AL_Research__Search_Browser=0x1C6,
|
||||
AL_Audio_Player=0x1C7,
|
||||
Generic_GUI_Application_Controls=0x200,
|
||||
AC_New=0x201,
|
||||
AC_Open=0x202,
|
||||
AC_Close=0x203,
|
||||
AC_Exit=0x204,
|
||||
AC_Maximize=0x205,
|
||||
AC_Minimize=0x206,
|
||||
AC_Save=0x207,
|
||||
AC_Print=0x208,
|
||||
AC_Properties=0x209,
|
||||
AC_Undo=0x21A,
|
||||
AC_Copy=0x21B,
|
||||
AC_Cut=0x21C,
|
||||
AC_Paste=0x21D,
|
||||
AC_Select_All=0x21E,
|
||||
AC_Find=0x21F,
|
||||
AC_Find_and_Replace=0x220,
|
||||
AC_Search=0x221,
|
||||
AC_Go_To=0x222,
|
||||
AC_Home=0x223,
|
||||
AC_Back=0x224,
|
||||
AC_Forward=0x225,
|
||||
AC_Stop=0x226,
|
||||
AC_Refresh=0x227,
|
||||
AC_Previous_Link=0x228,
|
||||
AC_Next_Link=0x229,
|
||||
AC_Bookmarks=0x22A,
|
||||
AC_History=0x22B,
|
||||
AC_Subscriptions=0x22C,
|
||||
AC_Zoom_In=0x22D,
|
||||
AC_Zoom_Out=0x22E,
|
||||
AC_Zoom=0x22F,
|
||||
AC_Full_Screen_View=0x230,
|
||||
AC_Normal_View=0x231,
|
||||
AC_View_Toggle=0x232,
|
||||
AC_Scroll_Up=0x233,
|
||||
AC_Scroll_Down=0x234,
|
||||
AC_Scroll=0x235,
|
||||
AC_Pan_Left=0x236,
|
||||
AC_Pan_Right=0x237,
|
||||
AC_Pan=0x238,
|
||||
AC_New_Window=0x239,
|
||||
AC_Tile_Horizontally=0x23A,
|
||||
AC_Tile_Vertically=0x23B,
|
||||
AC_Format=0x23C,
|
||||
AC_Edit=0x23D,
|
||||
AC_Bold=0x23E,
|
||||
AC_Italics=0x23F,
|
||||
AC_Underline=0x240,
|
||||
AC_Strikethrough=0x241,
|
||||
AC_Subscript=0x242,
|
||||
AC_Superscript=0x243,
|
||||
AC_All_Caps=0x244,
|
||||
AC_Rotate=0x245,
|
||||
AC_Resize=0x246,
|
||||
AC_Flip_horizontal=0x247,
|
||||
AC_Flip_Vertical=0x248,
|
||||
AC_Mirror_Horizontal=0x249,
|
||||
AC_Mirror_Vertical=0x24A,
|
||||
AC_Font_Select=0x24B,
|
||||
AC_Font_Color=0x24C,
|
||||
AC_Font_Size=0x24D,
|
||||
AC_Justify_Left=0x24E,
|
||||
AC_Justify_Center_H=0x24F,
|
||||
AC_Justify_Right=0x250,
|
||||
AC_Justify_Block_H=0x251,
|
||||
AC_Justify_Top=0x252,
|
||||
AC_Justify_Center_V=0x253,
|
||||
AC_Justify_Bottom=0x254,
|
||||
AC_Justify_Block_V=0x255,
|
||||
AC_Indent_Decrease=0x256,
|
||||
AC_Indent_Increase=0x257,
|
||||
AC_Numbered_List=0x258,
|
||||
AC_Restart_Numbering=0x259,
|
||||
AC_Bulleted_List=0x25A,
|
||||
AC_Promote=0x25B,
|
||||
AC_Demote=0x25C,
|
||||
AC_Yes=0x25D,
|
||||
AC_No=0x25E,
|
||||
AC_Cancel=0x25F,
|
||||
AC_Catalog=0x260,
|
||||
AC_Buy__Checkout=0x261,
|
||||
AC_Add_to_Cart=0x262,
|
||||
AC_Expand=0x263,
|
||||
AC_Expand_All=0x264,
|
||||
AC_Collapse=0x265,
|
||||
AC_Collapse_All=0x266,
|
||||
AC_Print_Preview=0x267,
|
||||
AC_Paste_Special=0x268,
|
||||
AC_Insert_Mode=0x269,
|
||||
AC_Delete=0x26A,
|
||||
AC_Lock=0x26B,
|
||||
AC_Unlock=0x26C,
|
||||
AC_Protect=0x26D,
|
||||
AC_Unprotect=0x26E,
|
||||
AC_Attach_Comment=0x26F,
|
||||
AC_Delete_Comment=0x270,
|
||||
AC_View_Comment=0x271,
|
||||
AC_Select_Word=0x272,
|
||||
AC_Select_Sentence=0x273,
|
||||
AC_Select_Paragraph=0x274,
|
||||
AC_Select_Column=0x275,
|
||||
AC_Select_Row=0x276,
|
||||
AC_Select_Table=0x277,
|
||||
AC_Select_Object=0x278,
|
||||
AC_Redo__Repeat=0x279,
|
||||
AC_Sort=0x27A,
|
||||
AC_Sort_Ascending=0x27B,
|
||||
AC_Sort_Descending=0x27C,
|
||||
AC_Filter=0x27D,
|
||||
AC_Set_Clock=0x27E,
|
||||
AC_View_Clock=0x27F,
|
||||
AC_Select_Time_Zone=0x280,
|
||||
AC_Edit_Time_Zones=0x281,
|
||||
AC_Set_Alarm=0x282,
|
||||
AC_Clear_Alarm=0x283,
|
||||
AC_Snooze_Alarm=0x284,
|
||||
AC_Reset_Alarm=0x285,
|
||||
AC_Synchronize=0x286,
|
||||
AC_Send__Receive=0x287,
|
||||
AC_Send_To=0x288,
|
||||
AC_Reply=0x289,
|
||||
AC_Reply_All=0x28A,
|
||||
AC_Forward_Msg=0x28B,
|
||||
AC_Send=0x28C,
|
||||
AC_Attach_File=0x28D,
|
||||
AC_Upload=0x28E,
|
||||
AC_Download_Save_Target_As=0x28F,
|
||||
AC_Set_Borders=0x290,
|
||||
AC_Insert_Row=0x291,
|
||||
AC_Insert_Column=0x292,
|
||||
AC_Insert_File=0x293,
|
||||
AC_Insert_Picture=0x294,
|
||||
AC_Insert_Object=0x295,
|
||||
AC_Insert_Symbol=0x296,
|
||||
AC_Save_and_Close=0x297,
|
||||
AC_Rename=0x298,
|
||||
AC_Merge=0x299,
|
||||
AC_Split=0x29A,
|
||||
AC_Distribute_Horizontally=0x29B,
|
||||
AC_Distribute_Vertically=0x29C,
|
||||
)
|
||||
HID_CONSUMERCODES[0x20] = '+10'
|
||||
HID_CONSUMERCODES[0x21] = '+100'
|
||||
HID_CONSUMERCODES._fallback = lambda x: 'unknown:%04X' % x
|
||||
|
||||
for code in HID_CONSUMERCODES:
|
||||
KEYS[0x07000000 + (int(code) << 8)] = str(code)
|
||||
|
|
Loading…
Reference in New Issue