fix ctrl+g

This commit is contained in:
Eduardo Bart 2011-12-16 19:13:03 -02:00
parent d78278379b
commit a4eed64709
5 changed files with 25 additions and 13 deletions

View File

@ -1,5 +1,4 @@
ParticleSystem ParticleSystem
AttractionAffector AttractionAffector
destination: 200 200 destination: 200 200
acceleration: 64 acceleration: 64
@ -11,15 +10,11 @@ ParticleSystem
burstRate: 2 burstRate: 2
burstCount: 1 burstCount: 1
delay: 0.5 delay: 0.5
particle-duration: 9999 particle-duration: 9999
particle-position-radius: 0 particle-position-radius: 0
particle-velocity: 32
particle-velocity: 64
particle-velocity-angle: 0 particle-velocity-angle: 0
particle-acceleration: 0 particle-acceleration: 0
particle-size: 32 32 particle-size: 32 32
particle-color: #33ff33ff particle-color: #33ff33ff
particle-texture: circle2.png particle-texture: circle2.png
@ -28,15 +23,11 @@ ParticleSystem
position: 200 200 position: 200 200
burstRate: 9999999999 burstRate: 9999999999
burstCount: 1 burstCount: 1
particle-duration: 9999999 particle-duration: 9999999
particle-position-radius: 0 particle-position-radius: 0
particle-velocity: 0 particle-velocity: 0
particle-velocity-angle: 0 particle-velocity-angle: 0
particle-acceleration: 0 particle-acceleration: 0
particle-size: 32 32 particle-size: 32 32
particle-color: #33ff33ff particle-color: #33ff33ff
particle-texture: circle2.png particle-texture: circle2.png

View File

@ -48,5 +48,20 @@ private:
extern Clock g_clock; 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 #endif

View File

@ -562,6 +562,7 @@ void X11Window::poll()
int len; int len;
m_inputEvent.keyboardModifiers = 0; m_inputEvent.keyboardModifiers = 0;
m_inputEvent.keyText = "";
if(event.xkey.state & ControlMask) if(event.xkey.state & ControlMask)
m_inputEvent.keyboardModifiers |= Fw::KeyboardCtrlModifier; m_inputEvent.keyboardModifiers |= Fw::KeyboardCtrlModifier;
if(event.xkey.state & ShiftMask) if(event.xkey.state & ShiftMask)
@ -590,6 +591,11 @@ void X11Window::poll()
//logDebug("char: ", buf[0], " code: ", (uint)buf[0]); //logDebug("char: ", buf[0], " code: ", (uint)buf[0]);
m_inputEvent.keyText = buf; 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()) if(m_keyMap.find(keysym) != m_keyMap.end())

View File

@ -427,7 +427,7 @@ bool UILineEdit::onKeyPress(uchar keyCode, std::string keyText, int keyboardModi
if(UIWidgetPtr parent = getParent()) if(UIWidgetPtr parent = getParent())
parent->focusNextChild(Fw::TabFocusReason); parent->focusNextChild(Fw::TabFocusReason);
} }
} else if(!keyText.empty()) } else if(!keyText.empty() && (keyboardModifiers == Fw::KeyboardNoModifier || keyboardModifiers == Fw::KeyboardShiftModifier))
appendText(keyText); appendText(keyText);
else else
return false; return false;

View File

@ -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); chatLineEdit->appendText(keyText);
return true; return true;
} }