Rename checkFromAllegroKeyArray() members to isPressed()

This commit is contained in:
David Capello 2015-05-20 15:02:31 -03:00
parent 13aef4eecf
commit 9b9ac319dc
5 changed files with 11 additions and 11 deletions

View File

@ -172,7 +172,7 @@ private:
bool isKeyActionPressed(KeyAction action) {
if (Key* key = KeyboardShortcuts::instance()->action(action))
return key->checkFromAllegroKeyArray();
return key->isPressed();
else
return false;
}

View File

@ -194,7 +194,7 @@ bool Key::isPressed(Message* msg) const
ASSERT(dynamic_cast<KeyMessage*>(msg) != NULL);
for (const Accelerator& accel : accels()) {
if (accel.check(msg->keyModifiers(),
if (accel.isPressed(msg->keyModifiers(),
static_cast<KeyMessage*>(msg)->scancode(),
static_cast<KeyMessage*>(msg)->unicodeChar()) &&
(m_keycontext == KeyContext::Any ||
@ -206,10 +206,10 @@ bool Key::isPressed(Message* msg) const
return false;
}
bool Key::checkFromAllegroKeyArray()
bool Key::isPressed() const
{
for (const Accelerator& accel : this->accels()) {
if (accel.checkFromAllegroKeyArray())
if (accel.isPressed())
return true;
}
return false;
@ -658,7 +658,7 @@ tools::Tool* KeyboardShortcuts::getCurrentQuicktool(tools::Tool* currentTool)
{
if (currentTool && currentTool->getInk(0)->isSelection()) {
Key* key = action(KeyAction::CopySelection);
if (key && key->checkFromAllegroKeyArray())
if (key && key->isPressed())
return NULL;
}
@ -669,7 +669,7 @@ tools::Tool* KeyboardShortcuts::getCurrentQuicktool(tools::Tool* currentTool)
Key* key = quicktool(tool);
// Collect all tools with the pressed keyboard-shortcut
if (key && key->checkFromAllegroKeyArray()) {
if (key && key->isPressed()) {
return tool;
}
}

View File

@ -80,7 +80,7 @@ namespace app {
void add(const ui::Accelerator& accel, KeySource source);
bool isPressed(ui::Message* msg) const;
bool checkFromAllegroKeyArray();
bool isPressed() const;
bool hasAccel(const ui::Accelerator& accel) const;
void disableAccel(const ui::Accelerator& accel);

View File

@ -349,7 +349,7 @@ std::string Accelerator::toString() const
return buf;
}
bool Accelerator::check(KeyModifiers modifiers, KeyScancode scancode, int unicodeChar) const
bool Accelerator::isPressed(KeyModifiers modifiers, KeyScancode scancode, int unicodeChar) const
{
// Preprocess the character to be compared with the accelerator
#ifdef PREPROCESS_KEYS
@ -428,7 +428,7 @@ bool Accelerator::check(KeyModifiers modifiers, KeyScancode scancode, int unicod
return false;
}
bool Accelerator::checkFromAllegroKeyArray() const
bool Accelerator::isPressed() const
{
KeyModifiers modifiers = kKeyNoneModifier;

View File

@ -25,8 +25,8 @@ namespace ui {
bool isEmpty() const;
std::string toString() const;
bool check(KeyModifiers modifiers, KeyScancode scancode, int unicodeChar) const;
bool checkFromAllegroKeyArray() const;
bool isPressed(KeyModifiers modifiers, KeyScancode scancode, int unicodeChar) const;
bool isPressed() const;
bool operator==(const Accelerator& other) const;
bool operator!=(const Accelerator& other) const {