home *** CD-ROM | disk | FTP | other *** search
RISC OS BBC BASIC V Source | 1995-02-21 | 2.4 KB | 124 lines |
- >Rebinder
- "This program modifies the LineEditor module on disk to"
- "change the key bindings."
- '"You need to input the name of the file with the new"
- "keybindings in."'
- $M$="<LineEditor$Dir>.LineEditor"
- M$:len%=
- v$,N%
- T$(N%)
- C% N%, M% len%
- "OS_File",&FF,M$,M%,0
- T%=M%+len%-512
- L%=0
- N%-1
- T$(L%),C%?L%
- T$(L%)="vanilla" v%=L%
- v%=-1
- "No vanilla in key table":
- z(M%+M%!20),"Line Editor"+
- 9+v$)<>1
- "Incorrect key file version for module":
- "Key definitions file (RETURN for default): "F$
- F$="" F$="<LineEditor$Dir>.DfltKeys"
- WS$=" "+
- ::DIM XXX% 512:FOR L%=0 TO 511:XXX%?L%=T%?L%:NEXT
- L%=0
- 511:T%?L%=C%?v%:
- L$,"&")
- T$=
- L$,I%)
- HACKARAMA
- !1 I%=
- T$,"-"):
- I% T$=
- T$,I%-1)+"~"+
- T$,I%+1)
- K%=
- T$:K2%=K%
- T$,2)
- "0123456789ABCDEFabcdef",
- T$,1))=0
- T$=""
- T$,1)="~"
- T$=
- T$,2)
- T$,1)<>"&" T$="&"+T$
- K2%=
- T$,2)
- *4
- "0123456789ABCDEFabcdef",
- T$,1))=0
- T$=""
- T$,1))
- T$<>""
- T$=
- T$,2)
- T$ is the action token for key codes K% to K2%
- force to upper-case
- 13 t$=T$:T$="":
- L%=1
- t$:T$+=
- t$,L%,1)
- t%=0
- T$<>T$(t%)
- t%<N%
- t%+=1
- t%=N%
- "Bad TOKEN '"T$"'":
- K%<0
- K%>&1FF
- K2%<0
- K2%>&1FF
- "Bad key number":
- ::PRINTK%"-";K2%" ";t%
- L%=K%
- K2%:T%?L%=C%?t%:
- "OS_File",&0A,M$,&FFA,,M%,M%+len%
- "OS_Module",11,M%,len%
- ::FOR L%=0 TO 511:IF XXX%?L%<>T%?L% PRINTL%" ";XXX%?L%"->";T%?L%:N.ELSEN.
- z(A%):
- ?A%:A$+=
- ?A%:A%+=1:
- >KEYLIB
- 2.66
- ignore,3
- beepignore,65
- left,0
- right,4
- delword,106
- cright,9
- cleft,16
- sright,22
- sleft,32
- toggleinsert,47
- delline,53
- removeline,50
- complete,56
- completenext,59
- completeprev,61
- setmark,64
- copy,67
- swapmark,75
- cut,88
- deletenext,124
- delete,125
- wipehistory,139
- deltoend,144
- paste,145
- swapchars,153
- quote,168
- vanilla,174
- cup,189
- cdown,198
- up,199
- down,214
- sup,224
- sdown,225
- escape,226
- fnkey,246
- wipeallhistory,142
- enter,236
- return,240
- uncopy,232
-