mirror of
https://github.com/mauiaaron/apple2.git
synced 2025-02-28 21:29:35 +00:00
fix backspacing disk path in parameters interface
This commit is contained in:
parent
4856a33b28
commit
97282fa916
@ -28,6 +28,9 @@
|
||||
#include <pthread.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#include <sys/time.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#ifndef NDEBUG
|
||||
# if defined(__GNUC__)
|
||||
# pragma GCC diagnostic push
|
||||
|
@ -1057,7 +1057,7 @@ void c_interface_parameters()
|
||||
cur_y = option = 0; /* wrap both to first */
|
||||
}
|
||||
}
|
||||
else if (ch == kLEFT) /* Arrow left */
|
||||
else if ((ch == kLEFT) && (!is_backspace())) /* Arrow left */
|
||||
{
|
||||
switch (option)
|
||||
{
|
||||
|
16
src/keys.c
16
src/keys.c
@ -14,11 +14,9 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
#ifdef __linux__
|
||||
#include <linux/keyboard.h>
|
||||
#endif
|
||||
|
||||
#include "common.h"
|
||||
#include "keys.h"
|
||||
@ -51,7 +49,10 @@ pthread_mutex_t interface_mutex = PTHREAD_MUTEX_INITIALIZER;
|
||||
int x_val, y_val;
|
||||
#endif
|
||||
|
||||
#define SCODE_BS 14
|
||||
|
||||
static int next_key = -1;
|
||||
static int last_scancode = -1;
|
||||
static char caps_lock = 1; /* is enabled */
|
||||
static int in_mygetch = 0;
|
||||
|
||||
@ -421,6 +422,8 @@ void c_periodic_update(int dummysig) {
|
||||
void c_read_raw_key(int scancode, int pressed) {
|
||||
int *keymap = NULL;
|
||||
|
||||
last_scancode = scancode;
|
||||
|
||||
/* determine which key mapping to use */
|
||||
if (apple_mode == IIE_MODE || in_mygetch)
|
||||
{
|
||||
@ -508,6 +511,11 @@ void c_read_raw_key(int scancode, int pressed) {
|
||||
}
|
||||
}
|
||||
|
||||
bool is_backspace()
|
||||
{
|
||||
return (last_scancode == SCODE_BS);
|
||||
}
|
||||
|
||||
int c_mygetch(int block)
|
||||
{
|
||||
int retval;
|
||||
|
@ -14,6 +14,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "common.h"
|
||||
|
||||
#ifndef A2_KEYS_H
|
||||
#define A2_KEYS_H
|
||||
|
||||
@ -90,5 +92,6 @@ void c_read_raw_key(int scancode, int pressed);
|
||||
void c_periodic_update(int dummysig);
|
||||
void enter_debugger(void);
|
||||
int c_mygetch(int block);
|
||||
bool is_backspace(); // is the current key actually a backspace?
|
||||
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user