mirror of
https://github.com/yann64/haikuports.git
synced 2026-04-22 19:50:05 +02:00
Update qemacs patch
* handle arrows in Terminal
This commit is contained in:
@@ -1130,7 +1130,7 @@ diff -urN qemacs-0.3.3.org/Makefile qemacs-0.3.3/Makefile
|
||||
kmaptoqe: kmaptoqe.c
|
||||
diff -urN qemacs-0.3.3.org/tty.c qemacs-0.3.3/tty.c
|
||||
--- qemacs-0.3.3.org/tty.c 2013-02-03 13:14:08.002621440 +0100
|
||||
+++ qemacs-0.3.3/tty.c 2013-03-08 00:25:01.355991552 +0100
|
||||
+++ qemacs-0.3.3/tty.c 2013-03-09 00:45:31.432275456 +0100
|
||||
@@ -150,7 +150,7 @@
|
||||
|
||||
tty_screen = s;
|
||||
@@ -1176,7 +1176,49 @@ diff -urN qemacs-0.3.3.org/tty.c qemacs-0.3.3/tty.c
|
||||
int ch;
|
||||
QEEvent ev1, *ev = &ev1;
|
||||
|
||||
@@ -399,7 +399,7 @@
|
||||
@@ -312,6 +312,7 @@
|
||||
ts->input_param = 0;
|
||||
} else if (ch == 'O') {
|
||||
ts->input_state = IS_ESC2;
|
||||
+ ts->input_param = 0;
|
||||
} else {
|
||||
ch = KEY_META(ch);
|
||||
ts->input_state = IS_NORM;
|
||||
@@ -347,13 +348,26 @@
|
||||
break;
|
||||
case IS_ESC2:
|
||||
/* xterm fn */
|
||||
- ts->input_state = IS_NORM;
|
||||
- if (ch >= 'P' && ch <= 'S') {
|
||||
- ch = KEY_F1 + ch - 'P';
|
||||
- the_end:
|
||||
- ev->key_event.type = QE_KEY_EVENT;
|
||||
- ev->key_event.key = ch;
|
||||
- qe_handle_event(ev);
|
||||
+ if (!isdigit(ch)) {
|
||||
+ ts->input_state = IS_NORM;
|
||||
+ if (ts->input_param == 5 && ch >= 'A' && ch <= 'D') {
|
||||
+ /* CTRL-arrows variant */
|
||||
+ ch += 'a' - 'A';
|
||||
+ ch = KEY_ESC1(ch);
|
||||
+ goto the_end;
|
||||
+ } else if (ch >= 'A' && ch <= 'D') {
|
||||
+ /* arrows variant */
|
||||
+ ch = KEY_ESC1(ch);
|
||||
+ goto the_end;
|
||||
+ } else if (ch >= 'P' && ch <= 'S') {
|
||||
+ ch = KEY_F1 + ch - 'P';
|
||||
+ the_end:
|
||||
+ ev->key_event.type = QE_KEY_EVENT;
|
||||
+ ev->key_event.key = ch;
|
||||
+ qe_handle_event(ev);
|
||||
+ }
|
||||
+ } else {
|
||||
+ ts->input_param = ts->input_param * 10 + ch - '0';
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -399,7 +413,7 @@
|
||||
static void term_fill_rectangle(QEditScreen *s,
|
||||
int x1, int y1, int w, int h, QEColor color)
|
||||
{
|
||||
@@ -1185,7 +1227,7 @@ diff -urN qemacs-0.3.3.org/tty.c qemacs-0.3.3/tty.c
|
||||
int x2 = x1 + w;
|
||||
int y2 = y1 + h;
|
||||
int x, y;
|
||||
@@ -443,7 +443,7 @@
|
||||
@@ -443,7 +457,7 @@
|
||||
return NULL;
|
||||
font->ascent = 0;
|
||||
font->descent = 1;
|
||||
@@ -1194,7 +1236,7 @@ diff -urN qemacs-0.3.3.org/tty.c qemacs-0.3.3/tty.c
|
||||
return font;
|
||||
}
|
||||
|
||||
@@ -493,7 +493,7 @@
|
||||
@@ -493,7 +507,7 @@
|
||||
int x, int y, const unsigned int *str, int len,
|
||||
QEColor color)
|
||||
{
|
||||
@@ -1203,7 +1245,7 @@ diff -urN qemacs-0.3.3.org/tty.c qemacs-0.3.3/tty.c
|
||||
TTYChar *ptr;
|
||||
int fgcolor, w, n;
|
||||
unsigned int cc;
|
||||
@@ -560,7 +560,7 @@
|
||||
@@ -560,7 +574,7 @@
|
||||
|
||||
static void term_flush(QEditScreen *s)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user