From c0e4cf48a402bc355558b7a99160da0659cfbfa2 Mon Sep 17 00:00:00 2001 From: Matthias Melcher Date: Thu, 17 Sep 2009 20:40:02 +0000 Subject: Starting to allow international (unicode) keystrokes as shortcuts. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@6877 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- test/utf8.cxx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'test/utf8.cxx') diff --git a/test/utf8.cxx b/test/utf8.cxx index 40eb12c90..ee418b44b 100644 --- a/test/utf8.cxx +++ b/test/utf8.cxx @@ -490,9 +490,10 @@ public: case FL_DND_RELEASE: return 1; case FL_PASTE: { + static const char lut[] = "0123456789abcdef"; const char *t = Fl::event_text(); int i, n; - fl_utf8decode(t, t+Fl::event_length(), &n); + unsigned int ucode = fl_utf8decode(t, t+Fl::event_length(), &n); if (n==0) { value(""); return 1; @@ -501,10 +502,15 @@ public: for (i=0; i>4)&0x0f]; *d++ = lut[t[i]&0x0f]; } + *d++ = ' '; + *d++ = '0'; + *d++ = 'x'; + *d++ = lut[(ucode>>20)&0x0f]; *d++ = lut[(ucode>>16)&0x0f]; + *d++ = lut[(ucode>>12)&0x0f]; *d++ = lut[(ucode>>8)&0x0f]; + *d++ = lut[(ucode>>4)&0x0f]; *d++ = lut[ucode&0x0f]; *d++ = 0; value(buffer); } -- cgit v1.2.3