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
AttractionAffector
destination: 200 200
acceleration: 64
@ -11,15 +10,11 @@ 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
@ -28,15 +23,11 @@ ParticleSystem
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

View File

@ -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

View File

@ -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())

View File

@ -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;

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);
return true;
}