mirror of
https://github.com/celisej567/mcpe.git
synced 2026-09-17 20:10:23 +03:00
* Allow handling of WM_CHAR in the case of Windows.
This commit is contained in:
@@ -478,7 +478,6 @@ void Minecraft::tickInput()
|
||||
Mouse::_index = -1;
|
||||
}
|
||||
|
||||
#ifndef ORIGINAL_CODE
|
||||
void Minecraft::tickMouse()
|
||||
{
|
||||
if (!m_bGrabbedMouse)
|
||||
@@ -486,7 +485,12 @@ void Minecraft::tickMouse()
|
||||
|
||||
platform()->recenterMouse();
|
||||
}
|
||||
#endif
|
||||
|
||||
void Minecraft::handleCharInput(char chr)
|
||||
{
|
||||
if (field_D14)
|
||||
field_D14->charInput(chr);
|
||||
}
|
||||
|
||||
void Minecraft::_levelGenerated()
|
||||
{
|
||||
|
||||
@@ -52,10 +52,8 @@ public:
|
||||
void joinMultiplayer(const PingedCompatibleServer& serverInfo);
|
||||
void cancelLocateMultiplayer();
|
||||
void locateMultiplayer();
|
||||
|
||||
#ifndef ORIGINAL_CODE
|
||||
void tickMouse();
|
||||
#endif
|
||||
void handleCharInput(char chr);
|
||||
|
||||
virtual void onGraphicsReset();
|
||||
virtual void update() override;
|
||||
|
||||
@@ -98,12 +98,16 @@ void Screen::keyPressed(int key)
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifndef ORIGINAL_CODE
|
||||
for (auto textInput : m_textInputs)
|
||||
{
|
||||
textInput->keyPressed(m_pMinecraft, key);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void Screen::charInput(char chr)
|
||||
{
|
||||
for (auto textInput : m_textInputs)
|
||||
textInput->charPressed(chr);
|
||||
}
|
||||
|
||||
void Screen::mouseClicked(int xPos, int yPos, int d) // d = clicked?
|
||||
|
||||
@@ -44,6 +44,7 @@ public:
|
||||
virtual void mouseClicked(int, int, int);
|
||||
virtual void mouseReleased(int, int, int);
|
||||
virtual void keyPressed(int);
|
||||
virtual void charInput(char);
|
||||
|
||||
public:
|
||||
int m_width = 1;
|
||||
|
||||
@@ -53,6 +53,7 @@ void TextInputBox::keyPressed(Minecraft* minecraft, int key)
|
||||
|
||||
bool bShiftPressed = minecraft->platform()->shiftPressed();
|
||||
|
||||
#ifndef HANDLE_CHARS_SEPARATELY
|
||||
char chr = '\0';
|
||||
if (key >= AKEYCODE_A && key <= AKEYCODE_Z)
|
||||
{
|
||||
@@ -114,6 +115,21 @@ void TextInputBox::keyPressed(Minecraft* minecraft, int key)
|
||||
chr = bShiftPressed ? '}' : ']';
|
||||
break;
|
||||
}
|
||||
#else
|
||||
char chr = '\0';
|
||||
switch (key)
|
||||
{
|
||||
case AKEYCODE_FORWARD_DEL:
|
||||
chr = '\001';
|
||||
break;
|
||||
case AKEYCODE_ARROW_LEFT:
|
||||
chr = '\002';
|
||||
break;
|
||||
case AKEYCODE_ARROW_RIGHT:
|
||||
chr = '\003';
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (chr)
|
||||
charPressed(chr);
|
||||
|
||||
Reference in New Issue
Block a user