Skip to content

Commit 9c0366f

Browse files
committed
SDL: fix keypad handling
1 parent a6db1a0 commit 9c0366f

File tree

11 files changed

+39
-17
lines changed

11 files changed

+39
-17
lines changed

Makefile.am

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,3 +64,6 @@ release:
6464
ndk-stack:
6565
adb logcat | ${NDK}/ndk-stack -sym src/platform/android/obj/local/armeabi
6666

67+
appImage:
68+
~/apps/linuxdeploy-x86_64.AppImage --appdir=AppDir --executable=./src/platform/fltk/sbasici && \
69+
~/apps/appimagetool-x86_64.AppImage AppDir

configure.ac

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
dnl
22
dnl Configure script for SmallBASIC
33
dnl
4-
dnl Copyright(C) 2001-2019 Chris Warren-Smith.
4+
dnl Copyright(C) 2001-2020 Chris Warren-Smith.
55
dnl
66
dnl This program is distributed under the terms of the GPL v2.0
77
dnl Download the GNU Public License (GPL) from www.gnu.org
88
dnl
99

10-
AC_INIT([smallbasic], [0.12.17])
10+
AC_INIT([smallbasic], [0.12.18])
1111
AC_CONFIG_SRCDIR([configure.ac])
1212

1313
AC_CANONICAL_TARGET

debian/changelog

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
smallbasic (0.12.18) unstable; urgency=low
2+
* Various see web site
3+
4+
-- Chris Warren-Smith <[email protected]> Wed, 05 Feb 2020 09:45:25 +1000
5+
16
smallbasic (0.12.17) unstable; urgency=low
27
* Various see web site
38

src/lib/miniaudio

src/platform/android/app/src/main/assets/main.bas

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ sub do_about()
119119
color 7
120120
print "Version "; sbver
121121
print
122-
print "Copyright (c) 2002-2019 Chris Warren-Smith"
122+
print "Copyright (c) 2002-2020 Chris Warren-Smith"
123123
print "Copyright (c) 1999-2006 Nicholas Christopoulos" + chr(10)
124124

125125
local bn_home

src/platform/android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ buildscript {
55
jcenter()
66
}
77
dependencies {
8-
classpath 'com.android.tools.build:gradle:3.5.2'
8+
classpath 'com.android.tools.build:gradle:3.5.3'
99
classpath "com.github.ben-manes:gradle-versions-plugin:0.22.0"
1010
}
1111
}

src/platform/sdl/editor.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ bool g_returnToLine;
2828
struct StatusMessage {
2929
explicit StatusMessage(TextEditInput *editor) :
3030
_dirty(editor->isDirty()),
31+
_insert(true),
3132
_row(editor->getRow()),
3233
_col(editor->getCol()) {
3334
}
@@ -61,6 +62,9 @@ struct StatusMessage {
6162
.append(",")
6263
.append(editor->getCol())
6364
.append(") ");
65+
if (!_insert) {
66+
message.append(" Ovwrt ");
67+
}
6468
int digits = snprintf(NULL, 0, "%d%d",
6569
editor->getRow(), editor->getCol());
6670
int spaces = 6 - digits;
@@ -93,7 +97,12 @@ struct StatusMessage {
9397
_dirty = !editor->isDirty();
9498
}
9599

100+
void setInsert() {
101+
_insert = !_insert;
102+
}
103+
96104
bool _dirty;
105+
bool _insert;
97106
int _row;
98107
int _col;
99108
String _fileName;
@@ -379,6 +388,12 @@ void System::editSource(String loadPath, bool restoreOnExit) {
379388
helpWidget->createCompletionHelp();
380389
helpWidget->show();
381390
break;
391+
case SB_KEY_INSERT:
392+
statusMessage.setInsert();
393+
widget->edit(event.key, sw, charWidth);
394+
statusMessage.update(editWidget, _output, true);
395+
redraw = true;
396+
break;
382397
case SB_KEY_CTRL('v'):
383398
case SB_KEY_SHIFT(SB_KEY_INSERT):
384399
text = getClipboardText();

src/platform/sdl/keymap.h

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,8 @@
1212
const int keymap[][2] = {
1313
{SDLK_RETURN, SB_KEY_ENTER},
1414
{SDLK_ESCAPE, SB_KEY_ESCAPE},
15-
{SDLK_KP_PERIOD, SB_KEY_KP_DEL},
16-
{SDLK_KP_ENTER, SB_KEY_KP_ENTER},
17-
{SDLK_KP_DIVIDE, SB_KEY_KP_DIV},
18-
{SDLK_KP_MULTIPLY, SB_KEY_KP_MUL},
19-
{SDLK_KP_MINUS, SB_KEY_KP_MINUS},
20-
{SDLK_KP_PLUS, SB_KEY_KP_PLUS},
21-
{SDLK_KP_EQUALS, '='},
15+
{SDLK_KP_PERIOD, '.'},
16+
{SDLK_KP_ENTER, SB_KEY_ENTER},
2217
{SDLK_TAB, SB_KEY_TAB},
2318
{SDLK_BACKSPACE, SB_KEY_BACKSPACE},
2419
{SDLK_DELETE, SB_KEY_DELETE},

0 commit comments

Comments
 (0)