Help with the keyboard and tv_text objects
Loridan
Posts: 12
All,
Let me start by saying that I am new to working with parallax products and I appreciate any help that you can offer. I have been trying to understand how to interface the television and keyboard. From what I can see the keyboard object can use getkey to get the (ASCII or keycode?) value of the key pressed. The lack of examples for this is depressing...
When I look at the file TV_Text.spin at the out() method it is declaring two local variables i and k? why? it doesn't even use them. In the same method we see $0D = return, but the ascii code for the enter key is $EB0D.
Can someone please explain to me what kind of character this out method is expecting, because it doesn't look like ascii. Again any help here is greatly appreciated. I'm just trying to echo the characters pressed on the keyboard to the television screen. I hope parallax or someone writes another book. I have the manual and I can't find this information anywhere.
Let me start by saying that I am new to working with parallax products and I appreciate any help that you can offer. I have been trying to understand how to interface the television and keyboard. From what I can see the keyboard object can use getkey to get the (ASCII or keycode?) value of the key pressed. The lack of examples for this is depressing...
When I look at the file TV_Text.spin at the out() method it is declaring two local variables i and k? why? it doesn't even use them. In the same method we see $0D = return, but the ascii code for the enter key is $EB0D.
Can someone please explain to me what kind of character this out method is expecting, because it doesn't look like ascii. Again any help here is greatly appreciated. I'm just trying to echo the characters pressed on the keyboard to the television screen. I hope parallax or someone writes another book. I have the manual and I can't find this information anywhere.
Comments
I see now that the out() method is taking unicode that maps to the character rom in the chip, so you can echo characters simply with term.out(kb.getkey).
My other questions still stand though... For example, why do so many of these methods have local variables declared after the | symbol that they are not using?
I guess my next project will be coding a gets method into the keyboard object and writing a word wrapping routine.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Paul Baker
Propeller Applications Engineer
Parallax, Inc.