From 219442cff707a1febb6a75ba2cfe48b02ae0a22e Mon Sep 17 00:00:00 2001 From: Tiago Cunha Date: Fri, 7 Jan 2011 14:34:45 +0000 Subject: Sync OpenBSD patchset 828: Support for UTF-8 mouse input (\033[1005h). This was added in xterm 262 and supports larger terminals than the older way. If the new mouse-utf8 option is on, UTF-8 mouse input is enabled for all UTF-8 terminals. The option defaults to on if LANG etc are set in the same manner as the utf8 option. With help and based on code from hsim at gmx.li. --- screen-write.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'screen-write.c') diff --git a/screen-write.c b/screen-write.c index 38596153..beb58db8 100644 --- a/screen-write.c +++ b/screen-write.c @@ -1,4 +1,4 @@ -/* $Id: screen-write.c,v 1.91 2010-12-30 22:27:38 tcunha Exp $ */ +/* $Id: screen-write.c,v 1.92 2011-01-07 14:34:45 tcunha Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -829,6 +829,18 @@ screen_write_insertmode(struct screen_write_ctx *ctx, int state) s->mode &= ~MODE_INSERT; } +/* Set UTF-8 mouse mode. */ +void +screen_write_utf8mousemode(struct screen_write_ctx *ctx, int state) +{ + struct screen *s = ctx->s; + + if (state) + s->mode |= MODE_MOUSE_UTF8; + else + s->mode &= ~MODE_MOUSE_UTF8; +} + /* Set mouse mode off. */ void screen_write_mousemode_off(struct screen_write_ctx *ctx) -- cgit