mirror of
https://github.com/AxioDL/metaforce.git
synced 2025-12-17 22:45:23 +00:00
Update TextField for Input Methods
This commit is contained in:
@@ -50,7 +50,8 @@ struct DeferredWindowEvents : public boo::IWindowCallback
|
||||
SpecialKeyDown,
|
||||
SpecialKeyUp,
|
||||
ModKeyDown,
|
||||
ModKeyUp
|
||||
ModKeyUp,
|
||||
UTF8FragmentDown
|
||||
} m_type;
|
||||
|
||||
boo::SWindowCoord m_coord;
|
||||
@@ -62,6 +63,7 @@ struct DeferredWindowEvents : public boo::IWindowCallback
|
||||
unsigned long m_charcode;
|
||||
boo::ESpecialKey m_special;
|
||||
bool m_isRepeat;
|
||||
std::string m_fragment;
|
||||
|
||||
void dispatch(Receiver& rec) const
|
||||
{
|
||||
@@ -112,6 +114,9 @@ struct DeferredWindowEvents : public boo::IWindowCallback
|
||||
case Type::ModKeyUp:
|
||||
rec.modKeyUp(m_mods);
|
||||
break;
|
||||
case Type::UTF8FragmentDown:
|
||||
rec.utf8FragmentDown(m_fragment);
|
||||
break;
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
@@ -240,6 +245,13 @@ struct DeferredWindowEvents : public boo::IWindowCallback
|
||||
m_cmds.back().m_mods = mod;
|
||||
}
|
||||
|
||||
void utf8FragmentDown(const std::string& str)
|
||||
{
|
||||
std::unique_lock<std::mutex> lk(m_mt);
|
||||
m_cmds.emplace_back(Command::Type::UTF8FragmentDown);
|
||||
m_cmds.back().m_fragment = str;
|
||||
}
|
||||
|
||||
void dispatchEvents()
|
||||
{
|
||||
std::unique_lock<std::mutex> lk(m_mt);
|
||||
|
||||
@@ -56,6 +56,7 @@ public:
|
||||
void specialKeyUp(boo::ESpecialKey key, boo::EModifierKey mods);
|
||||
void modKeyDown(boo::EModifierKey mod, bool isRepeat);
|
||||
void modKeyUp(boo::EModifierKey mod);
|
||||
void utf8FragmentDown(const std::string& str);
|
||||
|
||||
void dispatchEvents() {m_events.dispatchEvents();}
|
||||
void draw(boo::IGraphicsCommandQueue* gfxQ);
|
||||
@@ -73,10 +74,7 @@ public:
|
||||
m_activeTextView->setActive(false);
|
||||
m_activeTextView = textView;
|
||||
if (textView)
|
||||
{
|
||||
textView->setActive(true);
|
||||
m_window->claimKeyboardFocus();
|
||||
}
|
||||
}
|
||||
void setActiveDragView(View* dragView)
|
||||
{
|
||||
|
||||
@@ -52,6 +52,7 @@ public:
|
||||
void mouseLeave(const boo::SWindowCoord&);
|
||||
void charKeyDown(unsigned long, boo::EModifierKey, bool);
|
||||
void specialKeyDown(boo::ESpecialKey, boo::EModifierKey, bool);
|
||||
void utf8FragmentDown(const std::string&);
|
||||
void think();
|
||||
void resized(const boo::SWindowRect& rootView, const boo::SWindowRect& sub);
|
||||
void draw(boo::IGraphicsCommandQueue* gfxQ);
|
||||
|
||||
@@ -203,6 +203,7 @@ public:
|
||||
virtual void specialKeyUp(boo::ESpecialKey, boo::EModifierKey) {}
|
||||
virtual void modKeyDown(boo::EModifierKey, bool) {}
|
||||
virtual void modKeyUp(boo::EModifierKey) {}
|
||||
virtual void utf8FragmentDown(const std::string&) {}
|
||||
|
||||
virtual void resized(const boo::SWindowRect& root, const boo::SWindowRect& sub);
|
||||
virtual void think() {}
|
||||
|
||||
Reference in New Issue
Block a user