Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
What's new
4
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
Menu
Open sidebar
FPC
Lazarus
Lazarus
Commits
4ab08920
Commit
4ab08920
authored
Jul 07, 2017
by
Juha Manninen
Browse files
LCL-Win32: Process surrogate pairs correctly when virtual keyboard is used. Issue
#32101
.
git-svn-id: trunk@55459 -
parent
43fc0a13
Changes
2
Hide whitespace changes
Inline
Side-by-side
lcl/interfaces/win32/win32callback.inc
View file @
4ab08920
...
...
@@ -384,7 +384,7 @@ type
function
IsComboEditSelection
:
boolean
;
procedure
HandleBitBtnCustomDraw
(
ABitBtn
:
TCustomBitBtn
);
procedure
HandleDropFiles
;
function
HandleUnicodeChar
(
var
AChar
:
W
ord
):
boolean
;
function
HandleUnicodeChar
(
var
AChar
:
W
ideChar
):
boolean
;
procedure
UpdateDrawItems
;
procedure
UpdateDrawListItem
(
aMsg
:
UInt
);
procedure
UpdateLMMovePos
(
X
,
Y
:
Smallint
);
...
...
@@ -1114,13 +1114,13 @@ begin
end
;
// returns false if the UnicodeChar is not handled
function
TWindowProcHelper
.
HandleUnicodeChar
(
var
AChar
:
W
ord
)
:
boolean
;
function
TWindowProcHelper
.
HandleUnicodeChar
(
var
AChar
:
W
ideChar
)
:
boolean
;
var
OldUTF8Char
,
UTF8Char
:
TUTF8Char
;
WS
:
WideString
;
begin
Result
:=
False
;
UTF8Char
:=
UTF16ToUTF8
(
WideString
(
WideChar
(
AChar
))
)
;
UTF8Char
:=
UTF16ToUTF8
(
WideString
(
AChar
));
OldUTF8Char
:=
UTF8Char
;
if
Assigned
(
lWinControl
)
then
begin
...
...
@@ -1132,9 +1132,9 @@ begin
begin
WS
:=
UTF8ToUTF16
(
UTF8Char
);
if
Length
(
WS
)
>
0
then
AChar
:=
Word
(
WS
[
1
]
)
AChar
:=
WS
[
1
]
else
AChar
:=
0
;
AChar
:=
#
0;
end
;
end
;
end
;
...
...
@@ -1232,10 +1232,13 @@ end;
procedure
TWindowProcHelper
.
DoMsgChar
(
var
WinResult
:
LResult
);
begin
OrgCharCode
:=
Word
(
WParam
);
// Process surrogate pairs later
if
TCharacter
.
IsSurrogate
(
WideChar
(
OrgCharCode
))
then
WinProcess
:=
True
// first send a IntfUTF8KeyPress to the LCL
// if the key was not handled send a CN_CHAR for AnsiChar<=#127
OrgCharCode
:=
Word
(
WParam
);
if
not
HandleUnicodeChar
(
OrgCharCode
)
then
else
if
not
HandleUnicodeChar
(
WideChar
(
OrgCharCode
))
then
begin
PLMsg
:=
@
LMChar
;
with
LMChar
do
...
...
lcl/interfaces/win32/win32int.pp
View file @
4ab08920
...
...
@@ -29,7 +29,7 @@ interface
}
uses
Windows
,
//
keep
as
first
Classes
,
SysUtils
,
RtlConsts
,
ActiveX
,
MultiMon
,
CommCtrl
,
Classes
,
SysUtils
,
RtlConsts
,
ActiveX
,
MultiMon
,
CommCtrl
,
character
,
//
LCL
LCLPlatformDef
,
InterfaceBase
,
LCLIntf
,
LclProc
,
LCLType
,
LMessages
,
Controls
,
Buttons
,
Forms
,
Dialogs
,
GraphMath
,
GraphType
,
StdCtrls
,
...
...
FPC Admin account
@fpc_admin
mentioned in issue
#32101
·
Jul 29, 2021
mentioned in issue
#32101
mentioned in issue #32101
Toggle commit list
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment