ocarina: Find keypad numbers
I needed to strip out the "KP_" at the beginning. Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
This commit is contained in:
parent
6f69392e5f
commit
4c33ba82ec
|
@ -63,6 +63,9 @@ gboolean key_pressed(GtkWidget *widget, GdkEvent *event, gpointer data)
|
|||
ocarina::Playlist *plist = (ocarina::Playlist *)data;
|
||||
println("Treeview handling key press");
|
||||
|
||||
if (key.substr(0, 3) == "KP_")
|
||||
key = key.substr(3);
|
||||
|
||||
if (key == "s" || key == "S")
|
||||
new_playlist(plist, PLIST_SET);
|
||||
else if (key == "q" || key == "Q")
|
||||
|
|
|
@ -99,6 +99,9 @@ static gboolean key_pressed_after(GtkWidget *widget, GdkEvent *event, gpointer d
|
|||
string key = gdk_keyval_name(event->key.keyval);
|
||||
println("Window handling key press (2): " + key);
|
||||
|
||||
if (key.substr(0, 3) == "KP_")
|
||||
key = key.substr(3);
|
||||
|
||||
if (key >= "0" && key <= "9") {
|
||||
unsigned int k;
|
||||
stringstream s(key);
|
||||
|
|
Loading…
Reference in New Issue