|
|
|
@ -152,7 +152,7 @@ bool KBattleshipView::eventFilter(TQObject *object, TQEvent *event)
|
|
|
|
|
{
|
|
|
|
|
if(event->type() == TQEvent::KeyPress && m_decide)
|
|
|
|
|
{
|
|
|
|
|
TQKeyEvent *keyEvent = TQT_TQKEYEVENT(event);
|
|
|
|
|
TQKeyEvent *keyEvent = static_cast<TQKeyEvent*>(event);
|
|
|
|
|
if(keyEvent->key() == Key_Shift){
|
|
|
|
|
emit sigMouseOverField(m_lastX, m_lastY);
|
|
|
|
|
emit changeShipPlacementDirection();
|
|
|
|
@ -160,7 +160,7 @@ bool KBattleshipView::eventFilter(TQObject *object, TQEvent *event)
|
|
|
|
|
}
|
|
|
|
|
else if(event->type() == TQEvent::KeyRelease && m_decide)
|
|
|
|
|
{
|
|
|
|
|
TQKeyEvent *keyEvent = TQT_TQKEYEVENT(event);
|
|
|
|
|
TQKeyEvent *keyEvent = static_cast<TQKeyEvent*>(event);
|
|
|
|
|
if(keyEvent->key() == Key_Shift){
|
|
|
|
|
emit sigMouseOverField(m_lastX, m_lastY);
|
|
|
|
|
emit changeShipPlacementDirection();
|
|
|
|
@ -170,7 +170,7 @@ bool KBattleshipView::eventFilter(TQObject *object, TQEvent *event)
|
|
|
|
|
{
|
|
|
|
|
m_decide = false;
|
|
|
|
|
|
|
|
|
|
TQMouseEvent *mouseEvent = TQT_TQMOUSEEVENT(event);
|
|
|
|
|
TQMouseEvent *mouseEvent = static_cast<TQMouseEvent*>(event);
|
|
|
|
|
|
|
|
|
|
if(mouseEvent->button() == TQt::RightButton){
|
|
|
|
|
emit sigMouseOverField(m_lastX, m_lastY);
|
|
|
|
@ -237,7 +237,7 @@ bool KBattleshipView::eventFilter(TQObject *object, TQEvent *event)
|
|
|
|
|
setFocus();
|
|
|
|
|
m_decide = true;
|
|
|
|
|
|
|
|
|
|
TQMouseEvent *mouseEvent = TQT_TQMOUSEEVENT(event);
|
|
|
|
|
TQMouseEvent *mouseEvent = static_cast<TQMouseEvent*>(event);
|
|
|
|
|
|
|
|
|
|
TQPoint point(mouseEvent->x(), mouseEvent->y());
|
|
|
|
|
TQRect ownRect = m_battlefield->ownRect();
|
|
|
|
|