€•\=Œsphinx.addnodes”Œdocument”“”)”}”(Œ rawsource”Œ”Œchildren”]”(Œ translations”Œ LanguagesNode”“”)”}”(hhh]”(hŒ pending_xref”“”)”}”(hhh]”Œdocutils.nodes”ŒText”“”ŒChinese (Simplified)”…””}”Œparent”hsbaŒ attributes”}”(Œids”]”Œclasses”]”Œnames”]”Œdupnames”]”Œbackrefs”]”Œ refdomain”Œstd”Œreftype”Œdoc”Œ reftarget”Œ5/translations/zh_CN/userspace-api/media/rc/keytable.c”Œmodname”NŒ classname”NŒ refexplicit”ˆuŒtagname”hhh ubh)”}”(hhh]”hŒChinese (Traditional)”…””}”hh2sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ5/translations/zh_TW/userspace-api/media/rc/keytable.c”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒItalian”…””}”hhFsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ5/translations/it_IT/userspace-api/media/rc/keytable.c”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒJapanese”…””}”hhZsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ5/translations/ja_JP/userspace-api/media/rc/keytable.c”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒKorean”…””}”hhnsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ5/translations/ko_KR/userspace-api/media/rc/keytable.c”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒSpanish”…””}”hh‚sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ5/translations/sp_SP/userspace-api/media/rc/keytable.c”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubeh}”(h]”h ]”h"]”h$]”h&]”Œcurrent_language”ŒEnglish”uh1h hhŒ _document”hŒsource”NŒline”NubhŒcomment”“”)”}”(hŒCSPDX-License-Identifier: GPL-2.0 OR GFDL-1.1-no-invariants-or-later”h]”hŒCSPDX-License-Identifier: GPL-2.0 OR GFDL-1.1-no-invariants-or-later”…””}”hh£sbah}”(h]”h ]”h"]”h$]”h&]”Œ xml:space”Œpreserve”uh1h¡hhhžhhŸŒO/var/lib/git/docbuild/linux/Documentation/userspace-api/media/rc/keytable.c.rst”h KubhŒsection”“”)”}”(hhh]”(hŒtitle”“”)”}”(hŒfile: uapi/v4l/keytable.c”h]”hŒfile: uapi/v4l/keytable.c”…””}”(hh»hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¹hh¶hžhhŸh³h KubhŒ literal_block”“”)”}”(hX2/* keytable.c - This program allows checking/replacing keys at IR Copyright (C) 2006-2009 Mauro Carvalho Chehab 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, version 2 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. */ #include #include #include #include #include #include #include #include #include "parse.h" void prtcode (int *codes) { struct parse_key *p; for (p=keynames;p->name!=NULL;p++) { if (p->value == (unsigned)codes[1]) { printf("scancode 0x%04x = %s (0x%02x)\\n", codes[0], p->name, codes[1]); return; } } if (isprint (codes[1])) printf("scancode %d = '%c' (0x%02x)\\n", codes[0], codes[1], codes[1]); else printf("scancode %d = 0x%02x\\n", codes[0], codes[1]); } int parse_code(char *string) { struct parse_key *p; for (p=keynames;p->name!=NULL;p++) { if (!strcasecmp(p->name, string)) { return p->value; } } return -1; } int main (int argc, char *argv[]) { int fd; unsigned int i, j; int codes[2]; if (argc<2 || argc>4) { printf ("usage: %s to get table; or\\n" " %s \\n" " %s n",*argv,*argv,*argv); return -1; } if ((fd = open(argv[1], O_RDONLY)) < 0) { perror("Couldn't open input device"); return(-1); } if (argc==4) { int value; value=parse_code(argv[3]); if (value==-1) { value = strtol(argv[3], NULL, 0); if (errno) perror("value"); } codes [0] = (unsigned) strtol(argv[2], NULL, 0); codes [1] = (unsigned) value; if(ioctl(fd, EVIOCSKEYCODE, codes)) perror ("EVIOCSKEYCODE"); if(ioctl(fd, EVIOCGKEYCODE, codes)==0) prtcode(codes); return 0; } if (argc==3) { FILE *fin; int value; char *scancode, *keycode, s[2048]; fin=fopen(argv[2],"r"); if (fin==NULL) { perror ("opening keycode file"); return -1; } /* Clears old table */ for (j = 0; j < 256; j++) { for (i = 0; i < 256; i++) { codes[0] = (j << 8) | i; codes[1] = KEY_RESERVED; ioctl(fd, EVIOCSKEYCODE, codes); } } while (fgets(s,sizeof(s),fin)) { scancode=strtok(s,"\\n\\t =:"); if (!scancode) { perror ("parsing input file scancode"); return -1; } if (!strcasecmp(scancode, "scancode")) { scancode = strtok(NULL,"\\n\\t =:"); if (!scancode) { perror ("parsing input file scancode"); return -1; } } keycode=strtok(NULL,"\\n\\t =:("); if (!keycode) { perror ("parsing input file keycode"); return -1; } // printf ("parsing %s=%s:", scancode, keycode); value=parse_code(keycode); // printf ("\\tvalue=%d\\n",value); if (value==-1) { value = strtol(keycode, NULL, 0); if (errno) perror("value"); } codes [0] = (unsigned) strtol(scancode, NULL, 0); codes [1] = (unsigned) value; // printf("\\t%04x=%04x\\n",codes[0], codes[1]); if(ioctl(fd, EVIOCSKEYCODE, codes)) { fprintf(stderr, "Setting scancode 0x%04x with 0x%04x via ",codes[0], codes[1]); perror ("EVIOCSKEYCODE"); } if(ioctl(fd, EVIOCGKEYCODE, codes)==0) prtcode(codes); } return 0; } /* Get scancode table */ for (j = 0; j < 256; j++) { for (i = 0; i < 256; i++) { codes[0] = (j << 8) | i; if (!ioctl(fd, EVIOCGKEYCODE, codes) && codes[1] != KEY_RESERVED) prtcode(codes); } } return 0; }”h]”hX2/* keytable.c - This program allows checking/replacing keys at IR Copyright (C) 2006-2009 Mauro Carvalho Chehab 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, version 2 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. */ #include #include #include #include #include #include #include #include #include "parse.h" void prtcode (int *codes) { struct parse_key *p; for (p=keynames;p->name!=NULL;p++) { if (p->value == (unsigned)codes[1]) { printf("scancode 0x%04x = %s (0x%02x)\\n", codes[0], p->name, codes[1]); return; } } if (isprint (codes[1])) printf("scancode %d = '%c' (0x%02x)\\n", codes[0], codes[1], codes[1]); else printf("scancode %d = 0x%02x\\n", codes[0], codes[1]); } int parse_code(char *string) { struct parse_key *p; for (p=keynames;p->name!=NULL;p++) { if (!strcasecmp(p->name, string)) { return p->value; } } return -1; } int main (int argc, char *argv[]) { int fd; unsigned int i, j; int codes[2]; if (argc<2 || argc>4) { printf ("usage: %s to get table; or\\n" " %s \\n" " %s n",*argv,*argv,*argv); return -1; } if ((fd = open(argv[1], O_RDONLY)) < 0) { perror("Couldn't open input device"); return(-1); } if (argc==4) { int value; value=parse_code(argv[3]); if (value==-1) { value = strtol(argv[3], NULL, 0); if (errno) perror("value"); } codes [0] = (unsigned) strtol(argv[2], NULL, 0); codes [1] = (unsigned) value; if(ioctl(fd, EVIOCSKEYCODE, codes)) perror ("EVIOCSKEYCODE"); if(ioctl(fd, EVIOCGKEYCODE, codes)==0) prtcode(codes); return 0; } if (argc==3) { FILE *fin; int value; char *scancode, *keycode, s[2048]; fin=fopen(argv[2],"r"); if (fin==NULL) { perror ("opening keycode file"); return -1; } /* Clears old table */ for (j = 0; j < 256; j++) { for (i = 0; i < 256; i++) { codes[0] = (j << 8) | i; codes[1] = KEY_RESERVED; ioctl(fd, EVIOCSKEYCODE, codes); } } while (fgets(s,sizeof(s),fin)) { scancode=strtok(s,"\\n\\t =:"); if (!scancode) { perror ("parsing input file scancode"); return -1; } if (!strcasecmp(scancode, "scancode")) { scancode = strtok(NULL,"\\n\\t =:"); if (!scancode) { perror ("parsing input file scancode"); return -1; } } keycode=strtok(NULL,"\\n\\t =:("); if (!keycode) { perror ("parsing input file keycode"); return -1; } // printf ("parsing %s=%s:", scancode, keycode); value=parse_code(keycode); // printf ("\\tvalue=%d\\n",value); if (value==-1) { value = strtol(keycode, NULL, 0); if (errno) perror("value"); } codes [0] = (unsigned) strtol(scancode, NULL, 0); codes [1] = (unsigned) value; // printf("\\t%04x=%04x\\n",codes[0], codes[1]); if(ioctl(fd, EVIOCSKEYCODE, codes)) { fprintf(stderr, "Setting scancode 0x%04x with 0x%04x via ",codes[0], codes[1]); perror ("EVIOCSKEYCODE"); } if(ioctl(fd, EVIOCGKEYCODE, codes)==0) prtcode(codes); } return 0; } /* Get scancode table */ for (j = 0; j < 256; j++) { for (i = 0; i < 256; i++) { codes[0] = (j << 8) | i; if (!ioctl(fd, EVIOCGKEYCODE, codes) && codes[1] != KEY_RESERVED) prtcode(codes); } } return 0; }”…””}”hhËsbah}”(h]”h ]”h"]”h$]”h&]”h±h²Œforce”‰Œlanguage”Œc”Œhighlight_args”}”uh1hÉhŸh³h Khh¶hžhubeh}”(h]”Œfile-uapi-v4l-keytable-c”ah ]”h"]”Œfile: uapi/v4l/keytable.c”ah$]”h&]”uh1h´hhhžhhŸh³h Kubeh}”(h]”h ]”h"]”h$]”h&]”Œsource”h³uh1hŒcurrent_source”NŒ current_line”NŒsettings”Œdocutils.frontend”ŒValues”“”)”}”(h¹NŒ generator”NŒ datestamp”NŒ source_link”NŒ source_url”NŒ toc_backlinks”Œentry”Œfootnote_backlinks”KŒ sectnum_xform”KŒstrip_comments”NŒstrip_elements_with_classes”NŒ strip_classes”NŒ report_level”KŒ halt_level”KŒexit_status_level”KŒdebug”NŒwarning_stream”NŒ traceback”ˆŒinput_encoding”Œ utf-8-sig”Œinput_encoding_error_handler”Œstrict”Œoutput_encoding”Œutf-8”Œoutput_encoding_error_handler”j Œerror_encoding”Œutf-8”Œerror_encoding_error_handler”Œbackslashreplace”Œ language_code”Œen”Œrecord_dependencies”NŒconfig”NŒ id_prefix”hŒauto_id_prefix”Œid”Œ dump_settings”NŒdump_internals”NŒdump_transforms”NŒdump_pseudo_xml”NŒexpose_internals”NŒstrict_visitor”NŒ_disable_config”NŒ_source”h³Œ _destination”NŒ _config_files”]”Œ7/var/lib/git/docbuild/linux/Documentation/docutils.conf”aŒfile_insertion_enabled”ˆŒ raw_enabled”KŒline_length_limit”M'Œpep_references”NŒ pep_base_url”Œhttps://peps.python.org/”Œpep_file_url_template”Œpep-%04d”Œrfc_references”NŒ rfc_base_url”Œ&https://datatracker.ietf.org/doc/html/”Œ tab_width”KŒtrim_footnote_reference_space”‰Œsyntax_highlight”Œlong”Œ smart_quotes”ˆŒsmartquotes_locales”]”Œcharacter_level_inline_markup”‰Œdoctitle_xform”‰Œ docinfo_xform”KŒsectsubtitle_xform”‰Œ image_loading”Œlink”Œembed_stylesheet”‰Œcloak_email_addresses”ˆŒsection_self_link”‰Œenv”NubŒreporter”NŒindirect_targets”]”Œsubstitution_defs”}”Œsubstitution_names”}”Œrefnames”}”Œrefids”}”Œnameids”}”hãhàsŒ nametypes”}”hã‰sh}”hàh¶sŒ footnote_refs”}”Œ citation_refs”}”Œ autofootnotes”]”Œautofootnote_refs”]”Œsymbol_footnotes”]”Œsymbol_footnote_refs”]”Œ footnotes”]”Œ citations”]”Œautofootnote_start”KŒsymbol_footnote_start”KŒ id_counter”Œ collections”ŒCounter”“”}”…”R”Œparse_messages”]”Œtransform_messages”]”Œ transformer”NŒ include_log”]”Œ decoration”Nhžhub.