ELinks 0.18.0
mouse.c File Reference

Support for mouse interface. More...

#include <stdlib.h>
#include <string.h>
#include "elinks.h"
#include "config/home.h"
#include "config/options.h"
#include "dialogs/status.h"
#include "intl/libintl.h"
#include "main/select.h"
#include "main/timer.h"
#include "osdep/ascii.h"
#include "osdep/osdep.h"
#include "session/session.h"
#include "terminal/hardio.h"
#include "terminal/itrm.h"
#include "terminal/kbd.h"
#include "terminal/mouse.h"
#include "terminal/terminal.h"
#include "util/error.h"
#include "util/memory.h"
#include "util/string.h"
#include "util/time.h"
Include dependency graph for mouse.c:

Macros

#define HPUX_PIPE   1
 
#define write_sequence(fd, seq)    hard_write(fd, seq, sizeof(seq) - 1)
 
#define INIT_TWIN_MOUSE_SEQ   "\033[?9h"
 Send MIT Mouse Row & Column on Button Press.
 
#define INIT_XWIN_MOUSE_SEQ   "\033[?1000h\033[?1002h\033[?1005l\033[?1015l\033[?1006h"
 Send Mouse X & Y on button press and release.
 
#define DONE_TWIN_MOUSE_SEQ   "\033[?9l"
 Don't Send MIT Mouse Row & Column on Button Press.
 
#define DONE_XWIN_MOUSE_SEQ   "\033[?1000l\033[?1002l\033[?1006l"
 Don't Send Mouse X & Y on button press and release.
 
#define get_mouse_x_position(itrm, esclen)   decode_mouse_position(itrm, (esclen) + 1)
 
#define get_mouse_y_position(itrm, esclen)   decode_mouse_position(itrm, (esclen) + 3)
 
#define TW_BUTT_LEFT   1
 
#define TW_BUTT_MIDDLE   2
 
#define TW_BUTT_RIGHT   4
 

Functions

void send_mouse_init_sequence (int h)
 
void send_mouse_done_sequence (int h)
 
void disable_mouse (void)
 
static int mouse_lock_exists (void)
 
void enable_mouse (void)
 
void toggle_mouse (struct session *ses)
 
static int decode_mouse_position (struct itrm *itrm, int from)
 
int decode_terminal_mouse_escape_sequence (struct itrm *itrm, struct interlink_event *ev, int el, int v)
 
int decode_terminal_mouse_escape_sequence_256 (struct itrm *itrm, struct interlink_event *ev, int el, int v)
 

Variables

struct itrmditrm
 
int mouse_enabled
 
static int xterm_button = -1
 

Detailed Description

Support for mouse interface.

Macro Definition Documentation

◆ DONE_TWIN_MOUSE_SEQ

#define DONE_TWIN_MOUSE_SEQ   "\033[?9l"

Don't Send MIT Mouse Row & Column on Button Press.

◆ DONE_XWIN_MOUSE_SEQ

#define DONE_XWIN_MOUSE_SEQ   "\033[?1000l\033[?1002l\033[?1006l"

Don't Send Mouse X & Y on button press and release.

◆ get_mouse_x_position

#define get_mouse_x_position ( itrm,
esclen )   decode_mouse_position(itrm, (esclen) + 1)

◆ get_mouse_y_position

#define get_mouse_y_position ( itrm,
esclen )   decode_mouse_position(itrm, (esclen) + 3)

◆ HPUX_PIPE

#define HPUX_PIPE   1

◆ INIT_TWIN_MOUSE_SEQ

#define INIT_TWIN_MOUSE_SEQ   "\033[?9h"

Send MIT Mouse Row & Column on Button Press.

◆ INIT_XWIN_MOUSE_SEQ

#define INIT_XWIN_MOUSE_SEQ   "\033[?1000h\033[?1002h\033[?1005l\033[?1015l\033[?1006h"

Send Mouse X & Y on button press and release.

◆ TW_BUTT_LEFT

#define TW_BUTT_LEFT   1

◆ TW_BUTT_MIDDLE

#define TW_BUTT_MIDDLE   2

◆ TW_BUTT_RIGHT

#define TW_BUTT_RIGHT   4

◆ write_sequence

#define write_sequence ( fd,
seq )    hard_write(fd, seq, sizeof(seq) - 1)

Function Documentation

◆ decode_mouse_position()

static int decode_mouse_position ( struct itrm * itrm,
int from )
static

◆ decode_terminal_mouse_escape_sequence()

int decode_terminal_mouse_escape_sequence ( struct itrm * itrm,
struct interlink_event * ev,
int el,
int v )
Returns
length of the escape sequence or -1 if the caller needs to set up the ESC delay timer.

◆ decode_terminal_mouse_escape_sequence_256()

int decode_terminal_mouse_escape_sequence_256 ( struct itrm * itrm,
struct interlink_event * ev,
int el,
int v )

◆ disable_mouse()

void disable_mouse ( void )

◆ enable_mouse()

void enable_mouse ( void )

◆ mouse_lock_exists()

static int mouse_lock_exists ( void )
static

◆ send_mouse_done_sequence()

void send_mouse_done_sequence ( int h)

◆ send_mouse_init_sequence()

void send_mouse_init_sequence ( int h)

◆ toggle_mouse()

void toggle_mouse ( struct session * ses)

Variable Documentation

◆ ditrm

struct itrm* ditrm
extern

◆ mouse_enabled

int mouse_enabled

◆ xterm_button

int xterm_button = -1
static