Creating a Text Editor
Posted: Sun Nov 30, 2008 4:42 pm
I'm creating a simple text editor with Love, called Create Love...
I don't expect it to get anywhere, but I think it will be very useful for me to learn.
This is my first time using lua/love, so please point out mistakes or better ways to do things
Here is what I have so far:
Basically, I'm able to type text in lower case/upper case, add spaces, tabs and line breaks, and basic symbols (like .,/';[]).
I'll add more cases to check, like holding shift with a number to give !@#$%^&*(). Of course, different keyboards might have different symbols, so this will probably work best with just my keyboard
However, I need some help since like I said, I'm new.
How can I manipulate strings to take away the last character? I want to do this for backspace so I can delete characters.
Thanks!
EDIT: Oh wait, I notice that there are also constants for exclamation marks, question marks, etc. When are these constants returned?
Because when I use the keypressed() function, and I press 'shift+1', I get a 'shift' and a '1' returned, not a '!'.
I don't expect it to get anywhere, but I think it will be very useful for me to learn.
This is my first time using lua/love, so please point out mistakes or better ways to do things
Here is what I have so far:
Code: Select all
Removed to shorten post
I'll add more cases to check, like holding shift with a number to give !@#$%^&*(). Of course, different keyboards might have different symbols, so this will probably work best with just my keyboard
However, I need some help since like I said, I'm new.
How can I manipulate strings to take away the last character? I want to do this for backspace so I can delete characters.
Thanks!
EDIT: Oh wait, I notice that there are also constants for exclamation marks, question marks, etc. When are these constants returned?
Because when I use the keypressed() function, and I press 'shift+1', I get a 'shift' and a '1' returned, not a '!'.