Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions coresdk/src/coresdk/keyboard_input.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ namespace splashkit_lib
static map<key_code, bool> _keys_down;
static map<key_code, bool> _keys_just_typed; // i.e. those that have just gone down
static map<key_code, bool> _keys_released; // i.e. those that have just gone up
static bool _key_pressed = false;

static vector<key_callback *> _on_key_down;
static vector<key_callback *> _on_key_up;
Expand Down Expand Up @@ -70,7 +69,6 @@ namespace splashkit_lib

void _keyboard_start_process_events()
{
_key_pressed = false;
_keys_just_typed.clear();
_keys_released.clear();
}
Expand All @@ -79,7 +77,7 @@ namespace splashkit_lib
{
key_code keycode = static_cast<key_code>(code);
_keys_released[keycode] = true;
_keys_down[keycode] = false;
_keys_down.erase(keycode);
_raise_key_event(_on_key_up, keycode);
}

Expand Down Expand Up @@ -112,7 +110,14 @@ namespace splashkit_lib

bool any_key_pressed()
{
return _key_pressed;
if (_keys_down.size() > 0)
{
return true;
}
else
{
return false;
}
}

string key_name(key_code key)
Expand Down