? action.log
? ascii_patch.patch
? complete_text_entry.patch
? notify
? gui/Info.plist
? libltdl/COPYING.LIB
? libltdl/Makefile.am
? libltdl/Makefile.in
? libltdl/README
? libltdl/acinclude.m4
? libltdl/aclocal.m4
? libltdl/config-h.in
? libltdl/config.guess
? libltdl/config.sub
? libltdl/configure
? libltdl/configure.ac
? libltdl/install-sh
? libltdl/ltdl.c
? libltdl/ltdl.h
? libltdl/ltmain.sh
? libltdl/missing
Index: gui/gtk.cpp
===================================================================
RCS file: /sources/gnash/gnash/gui/gtk.cpp,v
retrieving revision 1.107
diff -u -r1.107 gtk.cpp
--- gui/gtk.cpp	11 Sep 2007 15:35:42 -0000	1.107
+++ gui/gtk.cpp	12 Sep 2007 06:21:50 -0000
@@ -1518,7 +1518,7 @@
     int mod = gdk_to_gnash_modifier(event->state);
     
     if (c != gnash::key::INVALID) {
-        gui->notify_key_event(c, mod, true);
+        gui->notify_key_event(c, gdk_keyval_to_unicode(event->keyval), mod, true);
     }
         
     return true;
@@ -1539,7 +1539,7 @@
     int mod = gdk_to_gnash_modifier(event->state);
     
     if (c != gnash::key::INVALID) {
-        gui->notify_key_event(c, mod, false);
+        gui->notify_key_event(c, gdk_keyval_to_unicode(event->keyval), mod, false);
     }
     
     return true;
Index: gui/gui.cpp
===================================================================
RCS file: /sources/gnash/gnash/gui/gui.cpp,v
retrieving revision 1.94
diff -u -r1.94 gui.cpp
--- gui/gui.cpp	22 Aug 2007 21:38:22 -0000	1.94
+++ gui/gui.cpp	12 Sep 2007 06:21:50 -0000
@@ -312,11 +312,11 @@
 }
 
 void
-Gui::notify_key_event(gnash::key::code k, int modifier, bool pressed) 
+Gui::notify_key_event(gnash::key::code k, uint32_t utf_8, int modifier, bool pressed) 
 {
 	movie_root* m = get_current_root();
 
-	if ( m->notify_key_event(k, pressed) )
+	if ( m->notify_key_event(k, utf_8, pressed) )
 	{
 		// any action triggered by the
 		// event required screen refresh
Index: gui/gui.h
===================================================================
RCS file: /sources/gnash/gnash/gui/gui.h,v
retrieving revision 1.60
diff -u -r1.60 gui.h
--- gui/gui.h	22 Aug 2007 21:38:22 -0000	1.60
+++ gui/gui.h	12 Sep 2007 06:21:51 -0000
@@ -182,7 +182,7 @@
     /// @param pressed Determines whether the key is being
     ///           pressed (true) or being released (false)
     ///
-    void notify_key_event(gnash::key::code k, int modifier, bool pressed);
+    void notify_key_event(gnash::key::code k, uint32_t utf_8, int modifier, bool pressed);
 
     /// Resize the client area view and the window accordingly.
     //
Index: server/edit_text_character.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/edit_text_character.cpp,v
retrieving revision 1.110
diff -u -r1.110 edit_text_character.cpp
--- server/edit_text_character.cpp	5 Sep 2007 16:47:55 -0000	1.110
+++ server/edit_text_character.cpp	12 Sep 2007 06:21:51 -0000
@@ -586,13 +586,15 @@
 		case event_id::KEY_PRESS:
 		{
 			std::string s(_text);
-			std::string c;
-			c = (char) id.m_key_code;
+			int c;
+			std::string uc;
+			c = id.m_key_code;
+			uc = (char) id.m_unicode;
 
 			// may be _text is changed in ActionScript
 			m_cursor = imin(m_cursor, _text.size());
 
-			switch (c[0])
+			switch (c)
 			{
 				case key::BACKSPACE:
 					if (m_cursor > 0)
@@ -640,7 +642,7 @@
 
 				default:
 				{
-					s.insert(m_cursor, c);
+					s.insert(m_cursor, uc);
 					m_cursor++;
 					set_text_value(s.c_str());
 					break;
Index: server/event_id.h
===================================================================
RCS file: /sources/gnash/gnash/server/event_id.h,v
retrieving revision 1.10
diff -u -r1.10 event_id.h
--- server/event_id.h	1 Jul 2007 10:54:22 -0000	1.10
+++ server/event_id.h	12 Sep 2007 06:21:51 -0000
@@ -95,13 +95,15 @@
 
 	id_code	m_id;
 	unsigned char	m_key_code;
+	uint32_t m_unicode;
 
-	event_id() : m_id(INVALID), m_key_code(key::INVALID) {}
+	event_id() : m_id(INVALID), m_key_code(key::INVALID), m_unicode(0) {}
 
-	event_id(id_code id, key::code c = key::INVALID)
+	event_id(id_code id, key::code c = key::INVALID, uint32_t utf_8 = 0)
 		:
 		m_id(id),
-		m_key_code((unsigned char) c)
+		m_key_code((unsigned char) c),
+		m_unicode ((uint32_t) utf_8)
 	{
 		// you must supply a key code for KEY_PRESS event
 		// 
Index: server/movie_root.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/movie_root.cpp,v
retrieving revision 1.85
diff -u -r1.85 movie_root.cpp
--- server/movie_root.cpp	7 Sep 2007 11:56:06 -0000	1.85
+++ server/movie_root.cpp	12 Sep 2007 06:21:52 -0000
@@ -290,7 +290,7 @@
 
 
 key_as_object *
-movie_root::notify_global_key(key::code k, bool down)
+movie_root::notify_global_key(key::code k, uint32_t utf_8, bool down)
 {
 	VM& vm = VM::get();
 	if ( vm.getSWFVersion() < 5 )
@@ -302,7 +302,7 @@
 	boost::intrusive_ptr<key_as_object> keyobject = getKeyObject();
 	if ( keyobject )
 	{
-		if (down) _keyobject->set_key_down(k);
+		if (down) _keyobject->set_key_down(k, utf_8);
 		else _keyobject->set_key_up(k);
 	}
 	else
@@ -314,17 +314,17 @@
 }
 
 bool
-movie_root::notify_key_event(key::code k, bool down)
+movie_root::notify_key_event(key::code k, uint32_t utf_8, bool down)
 {
 //GNASH_REPORT_FUNCTION;
 
 	//
 	// First of all, notify the _global.Key object about key event
 	//
-	key_as_object * global_key = notify_global_key(k, down);
+	key_as_object * global_key = notify_global_key(k, utf_8, down);
 
 	// Notify character key listeners.
-	notify_key_listeners(k, down);
+	notify_key_listeners(k, utf_8, down);
 
 #ifndef NEW_KEY_LISTENER_LIST_DESIGN
 	// Notify both character and non-character Key listeners
@@ -794,7 +794,7 @@
 #endif
 }
 
-void movie_root::notify_key_listeners(key::code k, bool down)
+void movie_root::notify_key_listeners(key::code k, uint32_t utf_8, bool down)
 {
     //log_msg("Notifying " SIZET_FMT " keypress listeners", _keyListeners.size());
 
@@ -824,7 +824,7 @@
                     }
                 }
                 // invoke onClipKeyPress handler
-                ch->on_event(event_id(event_id::KEY_PRESS, k));
+                ch->on_event(event_id(event_id::KEY_PRESS, k, utf_8));
             }
             else
             {
@@ -922,7 +922,7 @@
 #endif
 }
 
-void movie_root::notify_key_listeners(key::code k, bool down)
+void movie_root::notify_key_listeners(key::code k, uint32_t utf_8, bool down)
 {
 	log_msg("Notifying " SIZET_FMT " keypress listeners", 
 		m_key_listeners.size());
Index: server/movie_root.h
===================================================================
RCS file: /sources/gnash/gnash/server/movie_root.h,v
retrieving revision 1.71
diff -u -r1.71 movie_root.h
--- server/movie_root.h	1 Sep 2007 01:20:46 -0000	1.71
+++ server/movie_root.h	12 Sep 2007 06:21:52 -0000
@@ -332,7 +332,7 @@
     /// by the event requires redraw, see \ref events_handling for
     /// more info.
     ///
-    bool notify_key_event(key::code k, bool down);
+    bool notify_key_event(key::code k, uint32_t utf_8, bool down);
 
     /// \brief
     /// Use this to retrieve the last state of the mouse, as set via
@@ -477,7 +477,7 @@
     void * get_userdata() { return m_userdata; }
     void set_userdata(void * ud ) { m_userdata = ud;  }
 
-    DSOEXPORT void notify_key_listeners(key::code k, bool down);
+    DSOEXPORT void notify_key_listeners(key::code k, uint32_t utf_8, bool down);
 #ifdef NEW_KEY_LISTENER_LIST_DESIGN
     // Push a new key listener to the container if it is not there,
     // otherwise, just register it.
@@ -556,7 +556,7 @@
     void executeTimers();
 
     /// Notify the global Key ActionScript object about a key status change
-    key_as_object * notify_global_key(key::code k, bool down);
+    key_as_object * notify_global_key(key::code k, uint32_t utf_8, bool down);
     
     /// Remove all listeners with a ref-count of 1
     /// (only referenced as key listeners)
Index: server/asobj/Key.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/asobj/Key.cpp,v
retrieving revision 1.31
diff -u -r1.31 Key.cpp
--- server/asobj/Key.cpp	31 Aug 2007 21:53:32 -0000	1.31
+++ server/asobj/Key.cpp	12 Sep 2007 06:21:52 -0000
@@ -72,12 +72,14 @@
 }
 
 void
-key_as_object::set_key_down(int code)
+key_as_object::set_key_down(int code, uint32_t utf_8)
 {
     if (code < 0 || code >= key::KEYCOUNT) return;
 
     m_last_key_pressed = code;
 
+    m_last_unicode = utf_8;
+
     int byte_index = code >> 3;
     int bit_index = code - (byte_index << 3);
     int mask = 1 << bit_index;
@@ -198,6 +200,11 @@
     return m_last_key_pressed;
 }
 
+uint32_t
+key_as_object::get_last_unicode() const
+{
+    return m_last_unicode;
+}
 
 as_value
 key_add_listener(const fn_call& fn)
@@ -243,19 +250,13 @@
 {
     boost::intrusive_ptr<key_as_object> ko = ensureType<key_as_object>(fn.this_ptr);
 
-    int code = ko->get_last_key_pressed();
-    if (code < 0)
-        return as_value();
+    if (ko->get_last_key_pressed() < 0 ) return as_value();
 
-    // @@ Crude for now; just jamming the key code in a string, as a character.
-    // Need to apply shift/capslock/numlock, etc...
-    char    buf[2];
-    buf[0] = (char) code;
-    buf[1] = 0;
+    int utf8 = ko->get_last_unicode();
 
-    log_unimpl("Key.getAscii partially implemented");
+    if (utf8 < 0 || utf8 > 255) return as_value();
 
-    return as_value(buf);
+    return as_value(int(utf8));
 }
 
 // Returns the keycode of the last key pressed.
Index: server/asobj/Key.h
===================================================================
RCS file: /sources/gnash/gnash/server/asobj/Key.h,v
retrieving revision 1.24
diff -u -r1.24 Key.h
--- server/asobj/Key.h	24 Jul 2007 14:19:32 -0000	1.24
+++ server/asobj/Key.h	12 Sep 2007 06:21:52 -0000
@@ -63,6 +63,7 @@
 #endif
 
 	int	m_last_key_pressed;
+	uint32_t m_last_unicode;
 
 protected:
 
@@ -81,7 +82,7 @@
 
 	bool is_key_down(int code);
 
-	void set_key_down(int code);
+	void set_key_down(int code, uint32_t utf_8);
 
 	void set_key_up(int code);
 	
@@ -103,6 +104,8 @@
 
 	int get_last_key_pressed() const;
 
+	uint32_t get_last_unicode() const;
+
 };
 
 void key_class_init(as_object& global);
