diff options
author | ache <ache@FreeBSD.org> | 2001-03-11 22:51:05 +0000 |
---|---|---|
committer | ache <ache@FreeBSD.org> | 2001-03-11 22:51:05 +0000 |
commit | c710e20072d6904bbbbef48ace13e255b0a68195 (patch) | |
tree | 2512533075449cfea967cc9644806d4cb703b27b | |
parent | ef32330c570fe463e3c57d66c01ee23546bf36d3 (diff) | |
download | FreeBSD-src-c710e20072d6904bbbbef48ace13e255b0a68195.zip FreeBSD-src-c710e20072d6904bbbbef48ace13e255b0a68195.tar.gz |
Implement keyboard paste
PR: 25499
Submitted by: Gaspar Chilingarov <nm@web.am>
-rw-r--r-- | sys/dev/syscons/scmouse.c | 9 | ||||
-rw-r--r-- | sys/dev/syscons/syscons.c | 11 | ||||
-rw-r--r-- | sys/dev/syscons/syscons.h | 2 | ||||
-rw-r--r-- | sys/sys/kbio.h | 1 | ||||
-rw-r--r-- | usr.sbin/kbdcontrol/kbdcontrol.c | 8 | ||||
-rw-r--r-- | usr.sbin/kbdcontrol/lex.h | 1 | ||||
-rw-r--r-- | usr.sbin/kbdcontrol/lex.l | 1 |
7 files changed, 28 insertions, 5 deletions
diff --git a/sys/dev/syscons/scmouse.c b/sys/dev/syscons/scmouse.c index 30a983e..5830cfb 100644 --- a/sys/dev/syscons/scmouse.c +++ b/sys/dev/syscons/scmouse.c @@ -87,7 +87,6 @@ static void mouse_cut_end(scr_stat *scp); static void mouse_cut_word(scr_stat *scp); static void mouse_cut_line(scr_stat *scp); static void mouse_cut_extend(scr_stat *scp); -static void mouse_paste(scr_stat *scp); #endif /* SC_NO_CUTPASTE */ #ifndef SC_NO_CUTPASTE @@ -589,8 +588,8 @@ mouse_cut_extend(scr_stat *scp) } /* paste cut buffer contents into the current vty */ -static void -mouse_paste(scr_stat *scp) +void +sc_mouse_paste(scr_stat *scp) { if (scp->status & MOUSE_VISIBLE) sc_paste(scp, cut_buffer, strlen(cut_buffer)); @@ -784,7 +783,7 @@ sc_mouse_ioctl(struct tty *tp, u_long cmd, caddr_t data, int flag, mouse_cut_end(cur_scp); if (cur_scp->mouse_buttons & MOUSE_BUTTON2DOWN || cur_scp->mouse_buttons & MOUSE_BUTTON3DOWN) - mouse_paste(cur_scp); + sc_mouse_paste(cur_scp); } #endif /* SC_NO_CUTPASTE */ break; @@ -855,7 +854,7 @@ sc_mouse_ioctl(struct tty *tp, u_long cmd, caddr_t data, int flag, case 0: /* up */ break; default: - mouse_paste(cur_scp); + sc_mouse_paste(cur_scp); break; } break; diff --git a/sys/dev/syscons/syscons.c b/sys/dev/syscons/syscons.c index 631daa4..7742dc6 100644 --- a/sys/dev/syscons/syscons.c +++ b/sys/dev/syscons/syscons.c @@ -3066,6 +3066,17 @@ next_code: } break; + case PASTE: +#ifndef SC_NO_CUTPASTE + /* XXX need to set MOUSE_VISIBLE flag 'cause sc_mouse_paste() */ + /* and sc_paste() will not operate without it. */ + i = scp->status; + scp->status |= MOUSE_VISIBLE; + sc_mouse_paste(scp); + scp->status = i; +#endif + break; + /* NON-LOCKING KEYS */ case NOP: case LSH: case RSH: case LCTR: case RCTR: diff --git a/sys/dev/syscons/syscons.h b/sys/dev/syscons/syscons.h index 0c1d8e4..d667c97 100644 --- a/sys/dev/syscons/syscons.h +++ b/sys/dev/syscons/syscons.h @@ -548,6 +548,7 @@ int sc_inside_cutmark(scr_stat *scp, int pos); void sc_remove_cutmarking(scr_stat *scp); void sc_remove_all_cutmarkings(sc_softc_t *scp); void sc_remove_all_mouse(sc_softc_t *scp); +void sc_mouse_paste(scr_stat *scp); #else #define sc_draw_mouse_image(scp) #define sc_remove_mouse_image(scp) @@ -555,6 +556,7 @@ void sc_remove_all_mouse(sc_softc_t *scp); #define sc_remove_cutmarking(scp) #define sc_remove_all_cutmarkings(scp) #define sc_remove_all_mouse(scp) +#define sc_mouse_paste(scp) #endif /* SC_NO_CUTPASTE */ #ifndef SC_NO_SYSMOUSE void sc_mouse_move(scr_stat *scp, int x, int y); diff --git a/sys/sys/kbio.h b/sys/sys/kbio.h index a2e57d4..0ea3087 100644 --- a/sys/sys/kbio.h +++ b/sys/sys/kbio.h @@ -173,6 +173,7 @@ typedef struct keymap keymap_t; #define RALTA 0xa0 /* right alt key / alt lock */ #define HALT 0xa1 /* halt machine */ #define PDWN 0xa2 /* halt machine and power down */ +#define PASTE 0xa3 /* paste from cut-paste buffer */ #define F(x) ((x)+F_FN-1) #define S(x) ((x)+F_SCR-1) diff --git a/usr.sbin/kbdcontrol/kbdcontrol.c b/usr.sbin/kbdcontrol/kbdcontrol.c index 15a84f1..935a8d25 100644 --- a/usr.sbin/kbdcontrol/kbdcontrol.c +++ b/usr.sbin/kbdcontrol/kbdcontrol.c @@ -202,6 +202,8 @@ get_entry() return HALT | 0x100; case TPDWN: return PDWN | 0x100; + case TPASTE: + return PASTE | 0x100; case TACC: if (ACC(number) > L_ACC) return -1; @@ -439,6 +441,9 @@ print_entry(FILE *fp, int value) case PDWN | 0x100: fprintf(fp, " pdwn "); break; + case PASTE | 0x100: + fprintf(fp, " paste "); + break; default: if (value & 0x100) { if (val >= F_FN && val <= L_FN) @@ -638,6 +643,9 @@ dump_entry(int value) case PDWN: printf(" PDWN, "); break; + case PASTE: + printf("PASTE, "); + break; default: if (value >= F_FN && value <= L_FN) printf(" F(%2d),", value - F_FN + 1); diff --git a/usr.sbin/kbdcontrol/lex.h b/usr.sbin/kbdcontrol/lex.h index f3dff10..9dc1fdf 100644 --- a/usr.sbin/kbdcontrol/lex.h +++ b/usr.sbin/kbdcontrol/lex.h @@ -63,6 +63,7 @@ #define TRALTA 288 #define THALT 289 #define TPDWN 290 +#define TPASTE 291 extern int number; extern char letter; diff --git a/usr.sbin/kbdcontrol/lex.l b/usr.sbin/kbdcontrol/lex.l index 81314d4..35c488b 100644 --- a/usr.sbin/kbdcontrol/lex.l +++ b/usr.sbin/kbdcontrol/lex.l @@ -70,6 +70,7 @@ lalta|alta { return TLALTA; } ralta { return TRALTA; } halt { return THALT; } pdwn { return TPDWN; } +paste { return TPASTE; } NUL|nul { number = 0; return TNUM; } SOH|soh { number = 1; return TNUM; } |