mirror of
https://github.com/Oibaf66/frodo-wii.git
synced 2025-02-16 20:39:15 +01:00
Even further simplfication
This commit is contained in:
parent
fa07068d04
commit
1ee6fe673e
@ -302,7 +302,8 @@ void C64::bind_keys(Prefs *np)
|
||||
int key;
|
||||
bool shifted;
|
||||
|
||||
if (this->virtual_keyboard->get_key(&key) != false)
|
||||
key = this->virtual_keyboard->get_key();
|
||||
if (key >= 0)
|
||||
{
|
||||
this->prefs_changed = true;
|
||||
np->JoystickKeyBinding[opt] = key;
|
||||
|
@ -164,9 +164,9 @@ const char *VirtualKeyboard::keycode_to_string(int kc)
|
||||
return out;
|
||||
}
|
||||
|
||||
bool VirtualKeyboard::get_key(int *kc)
|
||||
int VirtualKeyboard::get_key()
|
||||
{
|
||||
bool out = false;
|
||||
int kc = -1;
|
||||
|
||||
while(1)
|
||||
{
|
||||
@ -192,11 +192,10 @@ bool VirtualKeyboard::get_key(int *kc)
|
||||
else if (k & KEY_SELECT)
|
||||
{
|
||||
virtkey_t key = keys[ this->sel_y * KEY_COLS + this->sel_x ];
|
||||
out = true;
|
||||
|
||||
*kc = key.kc;
|
||||
kc = key.kc;
|
||||
if (this->shift_on)
|
||||
*kc |= 0x80;
|
||||
kc |= 0x80;
|
||||
|
||||
if (key.is_shift == true)
|
||||
this->toggle_shift();
|
||||
@ -206,5 +205,6 @@ bool VirtualKeyboard::get_key(int *kc)
|
||||
}
|
||||
|
||||
SDL_FillRect(screen, 0, SDL_MapRGB(screen->format, 0, 0, 0));
|
||||
return out;
|
||||
|
||||
return kc;
|
||||
}
|
||||
|
@ -16,7 +16,7 @@ class VirtualKeyboard
|
||||
{
|
||||
public:
|
||||
VirtualKeyboard(SDL_Surface *screen, TTF_Font *font);
|
||||
bool get_key(int *kc);
|
||||
int get_key();
|
||||
const char *keycode_to_string(int kc);
|
||||
|
||||
private:
|
||||
|
Loading…
x
Reference in New Issue
Block a user