Small improvements
This commit is contained in:
parent
0ee09aad2c
commit
ff70abd073
|
@ -716,7 +716,7 @@ inline void FApplication::performKeyboardAction()
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
inline void FApplication::performMouseAction()
|
inline void FApplication::performMouseAction() const
|
||||||
{
|
{
|
||||||
if ( ! mouse )
|
if ( ! mouse )
|
||||||
return;
|
return;
|
||||||
|
@ -736,6 +736,9 @@ inline void FApplication::performMouseAction()
|
||||||
case fc::Fkey_urxvt_mouse:
|
case fc::Fkey_urxvt_mouse:
|
||||||
mouse->setRawData (FMouse::urxvt, buffer);
|
mouse->setRawData (FMouse::urxvt, buffer);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
keyboard->hasUnprocessedInput() = mouse->hasUnprocessedInput();
|
keyboard->hasUnprocessedInput() = mouse->hasUnprocessedInput();
|
||||||
|
|
|
@ -84,7 +84,8 @@ FKeyboard::~FKeyboard() // destructor
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void FKeyboard::fetchKeyCode()
|
void FKeyboard::fetchKeyCode()
|
||||||
{
|
{
|
||||||
parseKeyBuffer();
|
if ( fkey_queue.size() < MAX_QUEUE_SIZE )
|
||||||
|
parseKeyBuffer();
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
@ -471,8 +472,7 @@ void FKeyboard::parseKeyBuffer()
|
||||||
ssize_t bytesread{};
|
ssize_t bytesread{};
|
||||||
FObject::getCurrentTime (&time_keypressed);
|
FObject::getCurrentTime (&time_keypressed);
|
||||||
|
|
||||||
while ( fkey_queue.size() < MAX_QUEUE_SIZE
|
while ( (bytesread = readKey()) > 0 )
|
||||||
&& (bytesread = readKey()) > 0 )
|
|
||||||
{
|
{
|
||||||
has_pending_input = false;
|
has_pending_input = false;
|
||||||
|
|
||||||
|
@ -509,6 +509,9 @@ void FKeyboard::parseKeyBuffer()
|
||||||
}
|
}
|
||||||
|
|
||||||
fkey = 0;
|
fkey = 0;
|
||||||
|
|
||||||
|
if ( fkey_queue.size() >= MAX_QUEUE_SIZE )
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
read_character = 0;
|
read_character = 0;
|
||||||
|
|
|
@ -1576,7 +1576,8 @@ void FMouseControl::processEvent (struct timeval* time)
|
||||||
if ( mouse_object )
|
if ( mouse_object )
|
||||||
{
|
{
|
||||||
mouse_object->processEvent(time);
|
mouse_object->processEvent(time);
|
||||||
fmousedata_queue.emplace(new FMouseData(std::move(*mouse_object)));
|
const auto& md = static_cast<FMouseData>(*mouse_object);
|
||||||
|
fmousedata_queue.emplace(new FMouseData(std::move(md)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -184,7 +184,7 @@ class FApplication : public FWidget
|
||||||
void escapeKeyPressed() const;
|
void escapeKeyPressed() const;
|
||||||
void mouseTracking();
|
void mouseTracking();
|
||||||
void performKeyboardAction();
|
void performKeyboardAction();
|
||||||
void performMouseAction();
|
void performMouseAction() const;
|
||||||
void mouseEvent (const FMouseData&);
|
void mouseEvent (const FMouseData&);
|
||||||
void sendEscapeKeyPressEvent() const;
|
void sendEscapeKeyPressEvent() const;
|
||||||
bool sendKeyDownEvent (FWidget*) const;
|
bool sendKeyDownEvent (FWidget*) const;
|
||||||
|
|
Loading…
Reference in New Issue