I'm trying to write a simple text editor in pyglet as an exercise.
Everything has worked fine so far, including moving the cursor,
inserting/deleting text, etc. However, when I press the Return key, a
space character is passed to on_text(). If I hit Enter, no character
is passed at all.

Mac OS X 10.5.2, pyglet 1.1b1

My function:
def on_text(self,text):
        self.text_area.begin_update()
        self.text_area.document.insert_text(self.cursor,text)
        self.cursor += len(text)
        self.text_area.end_update()

I inserted a test line to print each character to the console in
quotes. Still showed up as a space.

If this is the intended behavior, how can I capture newline characters
another way?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pyglet-users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pyglet-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to