Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
I
Irrlicht New
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
Irrlicht New
Commits
1e05248e
Commit
1e05248e
authored
Dec 10, 2021
by
mercury233
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix linux paste
parent
e44c6720
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
12 deletions
+17
-12
include/irrString.h
include/irrString.h
+9
-0
source/Irrlicht/COSOperator.cpp
source/Irrlicht/COSOperator.cpp
+7
-4
source/Irrlicht/MacOSX/CIrrDeviceMacOSX.mm
source/Irrlicht/MacOSX/CIrrDeviceMacOSX.mm
+1
-8
No files found.
include/irrString.h
View file @
1e05248e
...
@@ -1360,6 +1360,15 @@ typedef string<c8> stringc;
...
@@ -1360,6 +1360,15 @@ typedef string<c8> stringc;
//! Typedef for wide character strings
//! Typedef for wide character strings
typedef
string
<
wchar_t
>
stringw
;
typedef
string
<
wchar_t
>
stringw
;
//! wrap of mbstowcs
static
inline
wchar_t
*
toWideChar
(
const
char
*
p
)
{
size_t
lenOld
=
strlen
(
p
);
wchar_t
*
ws
=
new
wchar_t
[
lenOld
+
1
];
size_t
lenNew
=
mbstowcs
(
ws
,
p
,
lenOld
);
ws
[
lenNew
]
=
0
;
return
ws
;
}
}
// end namespace core
}
// end namespace core
}
// end namespace irr
}
// end namespace irr
...
...
source/Irrlicht/COSOperator.cpp
View file @
1e05248e
...
@@ -9,6 +9,7 @@
...
@@ -9,6 +9,7 @@
#include <windows.h>
#include <windows.h>
#endif
#endif
#else
#else
#include <locale.h>
#include <string.h>
#include <string.h>
#include <unistd.h>
#include <unistd.h>
#ifndef _IRR_SOLARIS_PLATFORM_
#ifndef _IRR_SOLARIS_PLATFORM_
...
@@ -124,10 +125,12 @@ const c16* COSOperator::getTextFromClipboard() const
...
@@ -124,10 +125,12 @@ const c16* COSOperator::getTextFromClipboard() const
if
(
IrrDeviceLinux
)
if
(
IrrDeviceLinux
)
{
{
const
c8
*
p
=
IrrDeviceLinux
->
getTextFromClipboard
();
const
c8
*
p
=
IrrDeviceLinux
->
getTextFromClipboard
();
size_t
lenOld
=
strlen
(
p
);
wchar_t
*
ws
=
new
wchar_t
[
lenOld
+
1
];
char
*
oldLocale
=
setlocale
(
LC_CTYPE
,
NULL
);
size_t
lenNew
=
mbstowcs
(
ws
,
p
,
lenOld
);
setlocale
(
LC_CTYPE
,
""
);
ws
[
lenNew
]
=
0
;
wchar_t
*
ws
=
core
::
toWideChar
(
p
);
setlocale
(
LC_CTYPE
,
oldLocale
);
return
ws
;
return
ws
;
}
}
return
0
;
return
0
;
...
...
source/Irrlicht/MacOSX/CIrrDeviceMacOSX.mm
View file @
1e05248e
...
@@ -602,14 +602,7 @@ void CIrrDeviceMacOSX::processKeyEvent()
...
@@ -602,14 +602,7 @@ void CIrrDeviceMacOSX::processKeyEvent()
void
CIrrDeviceMacOSX
::
handleInputEvent
(
const
char
*
cStr
)
void
CIrrDeviceMacOSX
::
handleInputEvent
(
const
char
*
cStr
)
{
{
SEvent
ievent
;
SEvent
ievent
;
irr
::
core
::
stringw
widep
(
irr
::
core
::
toWideChar
(
cStr
));
// TODO: we should have such a function in core::string
size_t
lenOld
=
strlen
(
cStr
);
wchar_t
*
ws
=
new
wchar_t
[
lenOld
+
1
];
size_t
len
=
mbstowcs
(
ws
,
cStr
,
lenOld
);
ws
[
len
]
=
0
;
irr
::
core
::
stringw
widep
(
ws
);
delete
[]
ws
;
ievent
.
EventType
=
irr
::
EET_KEY_INPUT_EVENT
;
ievent
.
EventType
=
irr
::
EET_KEY_INPUT_EVENT
;
ievent
.
KeyInput
.
Key
=
(
irr
::
EKEY_CODE
)
0
;
ievent
.
KeyInput
.
Key
=
(
irr
::
EKEY_CODE
)
0
;
...
...
Write
Preview
Markdown
is supported
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