Mirror of CollapseOS
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

17 lines
441B

  1. ( handle backspace: go back one char in IN>, if possible, then
  2. emit BS + SPC + BS )
  3. : _bs
  4. ( already at IN( ? )
  5. IN> @ IN( = IF EXIT THEN
  6. IN> @ 1- IN> !
  7. BS SPC BS
  8. ;
  9. ( del is same as backspace )
  10. : BS? DUP 0x7f = SWAP 0x8 = OR ;
  11. : KEY
  12. 0x55 RAM+ @ ( (key) override )
  13. ?DUP IF EXECUTE ELSE (key) THEN ;
  14. ( cont.: read one char into input buffer and returns whether we
  15. should continue, that is, whether CR was not met. )