Hi Dean,

> I can match the (key) value of backspace to BS using 'if' but am not sure
> how to using 'case'
> 
> (setq BS "^?")

Note that "^?" is DEL (ASCII 127), mapped to by some keyboard drivers when the
backspace key is pressed.

Backspace (ASCII 8) is "^H".


> (setq Key (key))
> (if (= Key BS) (prinl "yes BS")) #works fine when backspace is pressed
> (case Key ("a" (prinl "a pressed"))) #works fine when "a" is pressed
> (case Key (BS (prinl "BS pressed"))) #???

'case' does not evaluate the clauses. But as the value of BS is constant, you
can use a read macro

   (case Key (`BS (prinl "BS pressed")))


But better catch both values:

   (prinl
      (case (key)
         (("^H" "^?") "BS pressed")
         (T "Other key pressed") ) )

♪♫ Alex
-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe

Reply via email to