home *** CD-ROM | disk | FTP | other *** search
/ RISC DISC 1 / RISC_DISC_1.iso / pd_share / utilities / zap / LineEditor / Rebinder (.txt) < prev    next >
Encoding:
RISC OS BBC BASIC V Source  |  1994-08-30  |  2.3 KB  |  120 lines

  1.  >Rebinder
  2. "This program modifies the LineEditor module on disk to"
  3. "change the key bindings."
  4. '"You need to input the name of the file with the new"
  5. "keybindings in."'
  6. $M$="<LineEditor$Dir>.LineEditor"
  7.  M$:len%=
  8.  v$,N%
  9.  T$(N%)
  10.  C% N%, M% len%
  11.  "OS_File",&FF,M$,M%,0
  12. T%=M%+len%-512
  13.  L%=0 
  14.  N%-1
  15.  T$(L%),C%?L%
  16. z(M%+M%!20),"Line Editor"+
  17. 9+v$)<>1 
  18. "Incorrect key file version for module":
  19.  "Key definitions file (RETURN for default): "F$
  20.  F$="" F$="<LineEditor$Dir>.DfltKeys"
  21. WS$=" "+
  22. ::DIM XXX% 512:FOR L%=0 TO 511:XXX%?L%=T%?L%:NEXT
  23.  L%=0 
  24.  511:T%?L%=C%?0:
  25. L$,"&")
  26.   T$=
  27. L$,I%)
  28.  HACKARAMA
  29. 1  I%=
  30. T$,"-"):
  31.  I% T$=
  32. T$,I%-1)+"~"+
  33. T$,I%+1)
  34.   K%=
  35. T$:K2%=K%
  36. T$,2)
  37. "0123456789ABCDEFabcdef",
  38. T$,1))=0 
  39.  T$=""
  40. T$,1)="~" 
  41.    T$=
  42. T$,2)
  43. T$,1)<>"&" T$="&"+T$
  44.    K2%=
  45. T$,2)
  46. '4   
  47. "0123456789ABCDEFabcdef",
  48. T$,1))=0 
  49.  T$=""
  50. T$,1)) 
  51.  T$<>""
  52.    T$=
  53. T$,2)
  54.  T$ is the action token for key codes K% to K2%
  55.  force to upper-case
  56. .3  t$=T$:T$="":
  57.  L%=1
  58. t$:T$+=
  59. t$,L%,1)
  60.   t%=0
  61.  T$<>T$(t%) 
  62.  t%<N%
  63.    t%+=1
  64.  t%=N% 
  65. "Bad TOKEN '"T$"'":
  66.  K%<0 
  67.  K%>&1FF 
  68.  K2%<0 
  69.  K2%>&1FF 
  70. "Bad key number":
  71. ::PRINTK%"-";K2%" ";t%
  72.  L%=K% 
  73.  K2%:T%?L%=C%?t%:
  74.  "OS_File",&0A,M$,&FFA,,M%,M%+len%
  75.  "OS_Module",11,M%,len%
  76. ::FOR L%=0 TO 511:IF XXX%?L%<>T%?L% PRINTL%" ";XXX%?L%"->";T%?L%:N.ELSEN.
  77. z(A%):
  78.  ?A%:A$+=
  79. ?A%:A%+=1:
  80.  >KEYLIB
  81.  2.63
  82.  ignore,3
  83.  beepignore,65
  84.  left,0
  85.  right,4
  86.  delword,103
  87.  cright,9
  88.  cleft,16
  89.  sright,22
  90.  sleft,32
  91.  toggleinsert,47
  92.  delline,53
  93.  removeline,50
  94.  complete,56
  95.  completenext,59
  96.  completeprev,61
  97.  setmark,64
  98.  copy,67
  99.  swapmark,72
  100.  cut,85
  101.  deletenext,121
  102.  delete,122
  103.  wipehistory,136
  104.  deltoend,141
  105.  paste,142
  106.  swapchars,150
  107.  quote,165
  108.  vanilla,171
  109.  cup,183
  110.  cdown,192
  111.  up,208
  112.  down,223
  113.  sup,233
  114.  sdown,234
  115.  escape,235
  116.  fnkey,248
  117.  wipeallhistory,139
  118.  enter,238
  119.  return,242
  120.