--- title: "A Cursor Pad" type: "article" slug: "a-cursor-pad" url: "http://localhost/article/a-cursor-pad/" markdown_url: "http://localhost/article/a-cursor-pad.md" published_at: "2022-09-14T02:44:32+00:00" modified_at: "2026-06-29T00:44:22+00:00" featured_image: url: "http://localhost/wp-content/uploads/2022/04/20230809-041332.jpg" excerpt: "A neat way of selecting from a menu or a collection of items on the screen is to move the cursor to the desired item. There is nothing new about this idea: many games and commercial programs use this technique. On our keyboard, moving the cursor is somewhat awkward: hold the cap shift down while…" category: - name: "Sincus News" slug: "sincus-news" taxonomy: "category" url: "http://localhost/category/periodicals/sincus-news/" post_tag: - name: "Best of Timex/Sinclair 2068 Articles and Documents" slug: "ts2068best" taxonomy: "post_tag" url: "http://localhost/tag/ts2068best/" - name: "Hardware project" slug: "hardware-project" taxonomy: "post_tag" url: "http://localhost/tag/hardware-project/" - 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_r: id: 14989 title: "Sincus News" type: "periodical" url: "http://localhost/periodical/sincus-news/" volume: "5" issue: "6" issues_articles: - id: 39389 title: "SINCUS v5 n6" type: "issue" url: "http://localhost/issue/sincus-v5-n6/" pages: "10" pubdate: "September - October 1987" archive_link: false gallery: - url: "http://localhost/wp-content/uploads/2022/09/cursor-control.png" --- # A Cursor Pad A neat way of selecting from a menu or a collection of items on the screen is to move the cursor to the desired item. There is nothing new about this idea: many games and commercial programs use this technique. On our keyboard, moving the cursor is somewhat awkward: hold the cap shift down while pressing 5 6 7 or B. Some of our more expensive cousins have special keys for moving the cursor. The cursor pad described here simulates these special keys. It plugs into a joystick port and, with appropriate software, moves the cursor around the screen. The gadget consists of a small plastic box (mine is 2″ by 3″ by 1″). Mounted in the top are 5 normally-open push button switches. Four are in a diamond pattern: up, down, left, right. The fifth is in the center and acts as the ENTER key. All these are available at Radio Shack. For the plug that attaches this to the joystick port, I found an elegant solution at Toys’R’Us – an extension cord for Atari joysticks. I cut this in half, and used the female end far the cursor pad. [Wes Brzozowski](http://localhost/indiv/wes-brzozowski/) described an alternative plug in his Light Pen article in Sep/Oct 86 SINCUS NEWS. In this example of the software I use, the cursor moves vertically only. Statements 400-500 simply create and display a list of items; your own program would obviously have a different list. The subprogram that controls the cursor is in statements 200-280. This routine requires values for K and L, which set bounds to the movement of the cursor, and which are supplied by statements 110 and 120. When the center key is pressed, the cursor pad subprogram returns in I the number of the selected item. Try it, with your joystick in the right-hand port! ## Source Code ``` 1 REM ** CURSOR PAD DEMO ** 2 50 GO SUB 400 60 100 REM SET CURSOR BOUNDS 110 LET K=2: REM ROW # OF FIRST ITEM 120 LET L=11: REM ROW # OF LAST ITEM 130 GO SUB 200 140 180 REM USE SELECTION 190 CLS : PRINT A$ (1): STOP 199 200 REM CURSOR PAD 210 LET I=L: OVER 1 220 GO SUB 280 230 IF STICK (1,2)0>0 THEN GO SUB 280: GO TO 260 240 IF STICK (2,2)=0 THEN GO TO 230 250 GO SUB 280: OVER : LET I=I-K+1: RETURN 260 LET I=I-(STICK (1,2)=1 AND I>K)+(STICK(1,2)=2 AND I