--- title: "Keyrcod & Keycod" type: "article" slug: "keyrcod-keycod" url: "http://localhost/article/keyrcod-keycod/" markdown_url: "http://localhost/article/keyrcod-keycod.md" published_at: "2026-11-11T11:07:24+00:00" modified_at: "2026-11-11T11:07:24+00:00" featured_image: url: "http://localhost/wp-content/uploads/2022/04/20230809-041332.jpg" excerpt: "Two small SuperBASIC procedures for program development, by Bruno Gadrat of the French QLCF club: KEYRCOD shows the values returned by KEYROW(0) to KEYROW(7) as keys are pressed, and KEYCOD shows the character and code of each key pressed. They are meant to be merged into a program and called by name; CTRL + space leaves them." post_tag: - name: "French language" slug: "french-language" taxonomy: "post_tag" url: "http://localhost/tag/french-language/" - name: "QL" slug: "ql" taxonomy: "post_tag" url: "http://localhost/tag/ql/" - name: "Superbasic (programming language)" slug: "superbasic-programming-language" taxonomy: "post_tag" url: "http://localhost/tag/superbasic-programming-language/" - name: "Type-in program" slug: "type-in-program" taxonomy: "post_tag" url: "http://localhost/tag/type-in-program/" model: - name: "Sinclair QL" slug: "sinclair-ql" taxonomy: "model" url: "http://localhost/model/sinclair-ql/" genre: - name: "Keyboard" slug: "keyboard" taxonomy: "genre" url: "http://localhost/type/keyboard/" publication: "QL_DOC" publication_r: id: 52925 title: "QL_DOC" type: "periodical" url: "http://localhost/periodical/ql_doc/" authors: "Bruno Gadrat" issue: "9" issues_articles: - id: 76722 title: "QL_DOC n9" type: "issue" url: "http://localhost/issue/ql_doc-n9/" pages: "16" pubdate: "April-May 1989" archive_link: false volumeissue: "n9" --- # Keyrcod & Keycod **In English:** Two small SuperBASIC procedures for program development, by Bruno Gadrat of the French QLCF club: KEYRCOD shows the values returned by KEYROW(0) to KEYROW(7) as keys are pressed, and KEYCOD shows the character and code of each key pressed. They are meant to be merged into a program and called by name; CTRL + space leaves them. *The article below is in French, as printed in QL_DOC n9 (April-May 1989).* *** Voici 2 procédures qui peuvent être utile lors de développement de programmes. KEYRCOD détermine les codes retournés par la fonction SuperBASIC KEYROW(x). KEYCOD retourne le code ASCII d’une touche appuyée. Pour utiliser ces procédures, on les appellent par leurs noms tout simplement. ``` 1 REMark Procedure KEYRCOD et KEYCOD 2 REMark de Bruno GADRAT (QLCF) 4 : 7 REMark La procedures KEYRCOD 8 REMark permet de trouver directement 9 REMark le ou les KEYROW(x) d'une touche 11 : 12 REMark la procédure KEYCOD permet de 13 REMark trouver le code des touches 14 : 15 REMark Il suffit de merger ces procedures 16 REMark a votre prgromme et d'appeler keyrcod 17 REMark ou keycod quand on en a besoin 18 REMark CTRL + barre vous sortent de ces 19 REMark procédures 21 : 7000 DEFine PROCedure keyrcod 7002 REPeat bouclekeyrow 7003 AT 0,0 7005 PRINT "0=";KEYROW(0);" ""1=";KEYROW(1);" ""2=";KEYROW(2);" " 7006 PRINT "3=";KEYROW(3);" ""4=";KEYROW(4);" ""5=";KEYROW(5);" " 7007 PRINT "6=";KEYROW(6);" ""7=";KEYROW(7);" " 7008 END REPeat bouclekeyrow 7009 END DEFine 7019 : 8000 DEFine PROCedure keycod 8001 REPeat bouclecod 8002 AT 0,0 8003 cod$=INKEY$(-1):PRINT cod$;" = ";CODE(cod$);" " 8004 END REPeat bouclecod 8005 END DEFine ```