It is currently Mon Oct 20, 2014 4:11 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 1 post ] 
Author Message
PostPosted: Sat Feb 01, 2014 7:31 pm 
Offline
User avatar
 Profile

Joined: Sat Mar 26, 2011 3:01 pm
Posts: 263
Location: Kings Langley
I found this while looking through some very old disks and forgot that I had copied it to my PC. I'm pretty sure I wrote it while trying to choose the 12 keys for the two players in Jeltron, but can't be sure - I may even have posted it here, but am getting a bit forgetful in my old age!

It displays a keyboard and then lights each key up as you push it, if a combination of keys also triggers another, that lights up to so that you can choose another - it probably would have been better to just warn of clashes, but this is what I have!

.ssd attached - this isn't great for emulators as the BBC can handle more keys at once than the PC!

10DATA 10,6, &20, "f0", &71, "f1", &72, "f2", &73, "f3", &14, "f4", &74, "f5", &75, "f6", &16, "f7", &76, "f8", &77, "f9"
20DATA 16,1, &70, "es", &30, "1" , &31, "2" , &11, "3" , &12, "4" , &13, "5" , &34, "6" , &24, "7" , &15, "8" , &26, "9" , &27, "0" , &17, "-" , &18, "^" , &78, "\" , &19, "<-", &79, "->"
30DATA 15,5, &10, "Q", &21, "W", &22, "E", &33, "R", &23, "T", &44, "Y", &35, "U", &25, "I", &36, "O", &37, "P", &47, "@", &38, "[", &28, "_", &39, "^", &29, "v"
40DATA 14,0, &40, "cl", &01, "ct", &41, "A", &51, "S", &32, "D", &43, "F", &53, "G", &54, "H", &45, "J", &46, "K", &56, "L", &57, ";", &48, ":", &58, "]"
50DATA 10,7, &61, "Z", &42, "X", &52, "C", &63, "V", &64, "B", &55, "N", &65, "M", &66, "<", &67, ">", &68, "/"
60DATA 16, &60, "tb", 1,2,4, &49, "rt", 42,3,6, &50, "sl", 0,4,3, &00, "sh", 3,4,4, &00, "sh", 37,4,5, &59, "dl", 42,4,3, &69, "cp", 45,4,3, &62, "sp", 10,5,24, &02
70DATA "8" , 34,5,2, &03, "7" , 36,5,2, &04, "6" , 38,5,2, &05, "5" , 40,5,2, &06, "4" , 42,5,2, &07, "3" , 44,5,2, &08, "2" , 46,5,2, &09, "1" , 48,5,2
80:
90*K.10O.|MREN.|ML.|M
100*FX 229 1
110MODE 4
120DIM n$(&79), xs(&79), ys(&79), ws(&79), ds(&79)
130:
140FOR w = 0 TO &79 : ws(w) = 0 : NEXT
150FOR y = 0 TO 4
160READ count, x
170FOR k = 1 TO count
180READ num, n$(num)
190xs(num) = x : x = x + 3
200ys(num) = y
210ws(num) = 3
220NEXT,
230:
240READ count
250FOR k = 1 TO count
260READ num, n$(num), xs(num), ys(num), ws(num)
270NEXT
280:
290VDU 5 : REM txt at gfx crsr
300FOR w = 0 TO &79
310IF ws(w) <> 0 THEN PROCdrawKey(w)
320NEXT
330VDU 4 : REM txt at txt crsr
340:
350FOR w = 0 TO &79
360ds(w) = INKEY(-1-w)
370IF ds(w) THEN PROCtoggleKey(w)
380NEXT
390:
400GCOL 4,1
410REPEAT
420FOR v = 0 TO &70 STEP &10
430FOR w = v TO v+&9
440state = INKEY(-1-w)
450IF state <> ds(w) THEN PROCtoggleKey(w)
460ds(w) = state
470NEXT,
480UNTIL FALSE
490:
500DEFPROCdrawKey(w)
510x = xs(w) * 24 + 40
520y = 1024 - ys(w) * 72 - 40
530MOVE x, y
540DRAW x+ws(w)*24-2, y
550DRAW x+ws(w)*24-2, y-68
560DRAW x, y-68
570DRAW x, y
580MOVE x+5, y-4
590PRINT n$(w)
600MOVE x+5, y-34
610PRINT ;~w
620ENDPROC
630:
640DEFPROCtoggleKey(w)
650x = xs(w) * 24 + 40
660y = 1024 - ys(w) * 72 - 40
670MOVE x, y
680MOVE x+ws(w)*24-4, y
690PLOT 85, x, y-68
700PLOT 85, x+ws(w)*24-4, y-68
710ENDPROC


Attachments:
File comment: same program twice - just run it and press keys - hold them down for a few seconds
defkeys.zip [1.22 KiB]
Downloaded 4 times
Top
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron