Shop OBEX P1 Docs P2 Docs Learn Events
Keypad To Screen interface — Parallax Forums

Keypad To Screen interface

PalastinePalastine Posts: 12
edited 2008-02-12 05:51 in Propeller 1
Hello every one

I have a code that·take a keypad input and display it in to an LCD screen.·But when I push on the backspace button on the keypad,·it does not erase instead it display a weird character, how can I get it to erase, please help. if you have a better code, that will be great also.

thanks in advance.
·


here is the code that i have

CON
······· _clkmode······· = xtal1 + pll16x
······· _xinfreq······· = 5_000_000

var
· byte c
OBJ
·· text : "vga_text"
······· term··· : "tv_terminal"
······· kb····· : "keyboard"

PUB start | i
·
· term.start(12)
· term.str(string("Keyboard...",13))·· '
· text.start(16)
· kb.start(26, 27)
· repeat
··· c := kb.getkey
··· text.out(c)

Comments

  • stevenmess2004stevenmess2004 Posts: 1,102
    edited 2008-02-10 07:34
    If you have a look at propDOS it has a section that does this. What you need to do is to check if the character is the backspace code and if it is set the last character to a space, and move the insert point back one.

    Steven
  • deSilvadeSilva Posts: 2,967
    edited 2008-02-10 07:36
    What do you think is so special about the BS key? All right . just kidding...

    The "TERM"-familiy conciders 7 or 8 special codes for OUT:
    $00 - clear screen
    $01 - home
    $08 - backspave
    $09 - tab
    $0A - set vertical position
    $0B - set horizontal position
    $0C - change of colour
    $0D - newline

    Make sure the code you "display" is an 8
  • PalastinePalastine Posts: 12
    edited 2008-02-10 15:39
    I just got the propeller and i am still in process of reading the manual and trying to understand it fully

    thanks, this information is helpfull
  • AribaAriba Posts: 2,685
    edited 2008-02-10 17:44
    You have to problems:
    1) The tv_terminal does not handle the Backspace, also if it is sent correct (see 2)
    I recommend to use tv_text.spin , not only because of the Backspaces.

    2) The problem is that "keyboard.spin" sends Backspace as $C8 and not as $08, so the tv_text driver does not recognize it.
    You can change the Entry in the table of keyboard.spin or, better the case value for Backspace in the tv_text.spin:
    In the out methode change this:
    change
               $08: if col
                      col--
    to
               $08,$C8: if col
                          col--
                          print(" ")
                          col--
    
    



    Andy
  • PalastinePalastine Posts: 12
    edited 2008-02-10 20:18
    thanks,

    I changed VGA_Text.spin and the backspace now works, but it only erase the current line and does not go to previous lines.

    another thing if, I type a sentence, when a word reach the end of the page it continues to the next line, is there an easy fix or do I need to write a code and set parameters.
  • deSilvadeSilva Posts: 2,967
    edited 2008-02-10 21:53
    You will profit immensely when you look into the extremely simple code of TV_TEXT. You can (and should!) change all the things you like
  • PalastinePalastine Posts: 12
    edited 2008-02-12 05:51
    thanks, i will do that.
Sign In or Register to comment.