fix backspacing disk path in parameters interface

This commit is contained in:
Aaron Culliney 2013-11-24 12:19:54 -08:00
parent 4856a33b28
commit 97282fa916
4 changed files with 19 additions and 5 deletions

View File

@ -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

View File

@ -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)
{

View File

@ -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;

View File

@ -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