simon-git: putty (master): Simon Tatham
Commits to Tartarus CVS repository.
tartarus-commits at lists.tartarus.org
Mon Jul 27 21:05:23 BST 2015
TL;DR:
7762d71 New centralised helper function dup_mb_to_wc().
67e5ceb Turn the Windows PuTTY main window into a Unicode window.
65f3500 Handle the VK_PACKET virtual key code.
Repository: git://git.tartarus.org/simon/putty.git
On the web: http://tartarus.org/~simon-git/gitweb/?p=putty.git
Branch updated: master
Committer: Simon Tatham <anakin at pobox.com>
Date: 2015-07-27 21:05:23
commit 7762d7122609207059cf5cf58fb2b9c2de98dd36
web diff http://tartarus.org/~simon-git/gitweb/?p=putty.git;a=commitdiff;h=7762d7122609207059cf5cf58fb2b9c2de98dd36;hp=9bea08a298580c98889834cbaffe289301753989
Author: Simon Tatham <anakin at pobox.com>
Date: Mon Jul 27 20:06:02 2015 +0100
New centralised helper function dup_mb_to_wc().
PuTTY's main mb_to_wc() function is all very well for embedding in
fiddly data pipelines, but for the simple job of turning a C string
into a C wide string, really I want something much more like
dupprintf. So here is one.
I've had to put it in a new separate source file miscucs.c rather than
throwing it into misc.c, because misc.c is linked into tools that
don't also include a module providing the internal Unicode API (winucs
or uxucs). The new miscucs.c appears only in Unicode-using tools.
Recipe | 4 ++--
misc.h | 9 +++++++++
miscucs.c | 28 ++++++++++++++++++++++++++++
3 files changed, 39 insertions(+), 2 deletions(-)
commit 67e5ceb9a8e6bc20fa0e0cf82ee9f89582e94112
web diff http://tartarus.org/~simon-git/gitweb/?p=putty.git;a=commitdiff;h=67e5ceb9a8e6bc20fa0e0cf82ee9f89582e94112;hp=7762d7122609207059cf5cf58fb2b9c2de98dd36
Author: Simon Tatham <anakin at pobox.com>
Date: Mon Jul 27 20:06:02 2015 +0100
Turn the Windows PuTTY main window into a Unicode window.
This causes WM_CHAR messages sent to us to have a wParam containing a
16-bit value encoded in UTF-16, rather than an 8-bit value encoded in
the system code page.
As far as I can tell, there aren't many other knock-on effects - e.g.
you can still interact with the window using ordinary char-based API
functions such as SetWindowText, and the Windows API will do the
necessary conversions behind the scenes. However, even so, I'm half
expecting some sort of unforeseen bug to show up as a result of this.
windows/window.c | 44 +++++++++++++++++++++++++++++---------------
1 file changed, 29 insertions(+), 15 deletions(-)
commit 65f3500906c38ee3cf66cc75a015058e5bc6e56d
web diff http://tartarus.org/~simon-git/gitweb/?p=putty.git;a=commitdiff;h=65f3500906c38ee3cf66cc75a015058e5bc6e56d;hp=67e5ceb9a8e6bc20fa0e0cf82ee9f89582e94112
Author: Simon Tatham <anakin at pobox.com>
Date: Mon Jul 27 20:06:02 2015 +0100
Handle the VK_PACKET virtual key code.
This is generated in response to the SendInput() Windows API call, if
that in turn is passed an KEYBDINPUT structure with KEYEVENTF_UNICODE
set. That method of input generation is used by programs such as
'WinCompose' to send an arbitrary Unicode character as if it had been
typed at the keyboard, even if the keyboard doesn't actually provide a
key for it.
Like VK_PROCESSKEY, this key code is an exception to our usual policy
of manually translating keystrokes: we handle it by calling
TranslateMessage, to get back the Unicode character it contains as a
WM_CHAR message.
(If that Unicode character in turn is outside the BMP, it may come
back as a pair of WM_CHARs in succession containing UTF-16 surrogates;
if so, that's OK, because the new Unicode WM_CHAR handler can cope.)
windows/window.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
More information about the tartarus-commits
mailing list