diff --git a/modules/particle.otpa b/modules/particle.otpa index 6720a01a..88de09d7 100644 --- a/modules/particle.otpa +++ b/modules/particle.otpa @@ -1,5 +1,4 @@ ParticleSystem - AttractionAffector destination: 200 200 acceleration: 64 @@ -11,32 +10,24 @@ ParticleSystem burstRate: 2 burstCount: 1 delay: 0.5 - particle-duration: 9999 particle-position-radius: 0 - - particle-velocity: 64 + particle-velocity: 32 particle-velocity-angle: 0 - particle-acceleration: 0 - particle-size: 32 32 particle-color: #33ff33ff particle-texture: circle2.png - + Emitter position: 200 200 burstRate: 9999999999 burstCount: 1 - particle-duration: 9999999 particle-position-radius: 0 - particle-velocity: 0 particle-velocity-angle: 0 - particle-acceleration: 0 - particle-size: 32 32 particle-color: #33ff33ff particle-texture: circle2.png diff --git a/src/framework/core/clock.h b/src/framework/core/clock.h index 39c2a747..72f68330 100644 --- a/src/framework/core/clock.h +++ b/src/framework/core/clock.h @@ -48,5 +48,20 @@ private: extern Clock g_clock; +class Timer +{ +public: + Timer() { restart(); } + + void restart() { m_startTicks = g_clock.ticks(); } + + ticks_t startTicks() { return m_startTicks; } + ticks_t ticksElapsed() { return g_clock.ticks() - m_startTicks; } + double timeElapsed() { return ticksElapsed()/1000.0; } + +private: + ticks_t m_startTicks; +}; + #endif diff --git a/src/framework/platform/x11window.cpp b/src/framework/platform/x11window.cpp index 5e36c4a0..5a786df6 100644 --- a/src/framework/platform/x11window.cpp +++ b/src/framework/platform/x11window.cpp @@ -562,6 +562,7 @@ void X11Window::poll() int len; m_inputEvent.keyboardModifiers = 0; + m_inputEvent.keyText = ""; if(event.xkey.state & ControlMask) m_inputEvent.keyboardModifiers |= Fw::KeyboardCtrlModifier; if(event.xkey.state & ShiftMask) @@ -590,6 +591,11 @@ void X11Window::poll() //logDebug("char: ", buf[0], " code: ", (uint)buf[0]); m_inputEvent.keyText = buf; } + } else { + len = XLookupString(&event.xkey, buf, sizeof(buf), &keysym, 0); + + if(len > 0) + m_inputEvent.keyText = buf; } if(m_keyMap.find(keysym) != m_keyMap.end()) diff --git a/src/framework/ui/uilineedit.cpp b/src/framework/ui/uilineedit.cpp index 31ea118d..4d3b1e5f 100644 --- a/src/framework/ui/uilineedit.cpp +++ b/src/framework/ui/uilineedit.cpp @@ -427,7 +427,7 @@ bool UILineEdit::onKeyPress(uchar keyCode, std::string keyText, int keyboardModi if(UIWidgetPtr parent = getParent()) parent->focusNextChild(Fw::TabFocusReason); } - } else if(!keyText.empty()) + } else if(!keyText.empty() && (keyboardModifiers == Fw::KeyboardNoModifier || keyboardModifiers == Fw::KeyboardShiftModifier)) appendText(keyText); else return false; diff --git a/src/otclient/ui/uigame.cpp b/src/otclient/ui/uigame.cpp index 21a781ba..2f84cc78 100644 --- a/src/otclient/ui/uigame.cpp +++ b/src/otclient/ui/uigame.cpp @@ -100,7 +100,7 @@ bool UIGame::onKeyPress(uchar keyCode, std::string keyText, int keyboardModifier } } - if(!keyText.empty()) { + if(!keyText.empty() && (keyboardModifiers == Fw::KeyboardNoModifier || keyboardModifiers == Fw::KeyboardShiftModifier)) { chatLineEdit->appendText(keyText); return true; }