--- title: "Basically “IN”" type: "article" slug: "basically-in-2" url: "http://localhost/article/basically-in-2/" markdown_url: "http://localhost/article/basically-in-2.md" published_at: "2022-01-19T01:58:07+00:00" modified_at: "2026-06-30T11:37:55+00:00" featured_image: url: "http://localhost/wp-content/uploads/2022/04/20230809-041332.jpg" excerpt: "An advantage of using the IN function instead of INKEY$ is that multiple keys can be sensed. If the keyboard was to be divided into 8 groups so that each group was half a row containing 5 keys, then these groups would be represented by IN addresses as follows: IN 65278 = keys CAPSHIFT to…" category: - name: "Sinc-Link" slug: "sinc-link" taxonomy: "category" url: "http://localhost/category/periodicals/sinc-link/" post_tag: - name: "Best of Timex/Sinclair 2068 Articles and Documents" slug: "ts2068best" taxonomy: "post_tag" url: "http://localhost/tag/ts2068best/" - name: "TS 2068" slug: "ts2068" taxonomy: "post_tag" url: "http://localhost/tag/ts2068/" - name: "Type-in program" slug: "type-in-program" taxonomy: "post_tag" url: "http://localhost/tag/type-in-program/" model: - name: "Timex/Sinclair 2068" slug: "ts-2068" taxonomy: "model" url: "http://localhost/model/ts-2068/" publication: "Sinc-Link" publication_r: id: 10240 title: "Sinc-Link" type: "periodical" url: "http://localhost/periodical/sinc-link/" authors: "Fred Schakel" authors_r: - name: "Fred Schakel" slug: "fred-schakel" taxonomy: "indiv" url: "http://localhost/indiv/fred-schakel/" volume: "4" issue: "1" issues_articles: - id: 38193 title: "Sinc-Link v4 n1" type: "issue" url: "http://localhost/issue/sinc-link-v4-n1/" pages: "11" pubdate: "January/February 1986" archive_link: false --- An advantage of using the IN function instead of INKEY$ is that multiple keys can be sensed. If the keyboard was to be divided into 8 groups so that each group was half a row containing 5 keys, then these groups would be represented by IN addresses as follows: ``` IN 65278 = keys CAPSHIFT to V IN 65022 = keys A to G IN 64510 = keys Q to T IN 63486 = keys 1 to 5 IN 61438 = keys O to 6 IN 57342 = keys P to Y IN 49150 = keys ENTER to H IN 32766 = keys SPACE to B ``` When IN 65278 equals 31 (binary 11111), none of the keys From CAPSHIFT to V are being pressed. If one of these keys was pressed, it would change the binary 1 to a zero. The least significant digit represents the key closest to the outside of the keyboard. For example, IN 61438 4s 19 (Binary 10011) indicating that both keys 7 and 8 are pressed. Check this by RUNning this one-line program: (press keys 6 to 0) ``` 10 PRINT AT 1,1: IN 61438: GOTO 10 ``` This only uses the 5 least significant digits of the address. The 6th least significant digit is the bit which presently appears at the EAR socket. IN 251 handles the data for the printer as does OUT 251. OUT 254 colors our border on the 3 least significant bits while its 4th and 5th bits are used for the MIC socket and the BEEPer respectively.