Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions docs/man/kmscon.1.xml.in
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,18 @@
(default: 50)</para>
</listitem>
</varlistentry>

<varlistentry>
<term><option>--mouse</option></term>
<listitem>
<para>Enable mouse/touchpad/trackpoint in kmscon (default: off).
It allows to select, and copy/paste text with a pointing device,
and also to scroll with the mouse wheel.
It's still experimental, and may not work with specific devices.
</para>
</listitem>
</varlistentry>

</variablelist>

<para>Grabs / Keyboard Shortcuts:</para>
Expand Down
12 changes: 12 additions & 0 deletions docs/man/kmscon.conf.1.xml.in
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ xkb-model=pc102
xkb-layout=de
xkb-repeat-delay=200
xkb-repeat-rate=65
mouse

### Video Options ###
drm
Expand Down Expand Up @@ -262,6 +263,17 @@ font-name=Ubuntu Mono
</listitem>
</varlistentry>

<varlistentry>
<term><option>--mouse</option></term>
<listitem>
<para>Enable mouse/touchpad/trackpoint in kmscon (default: off).
It allows to select, and copy/paste text with a pointing device,
and also to scroll with the mouse wheel.
It's still experimental, and may not work with specific devices.
</para>
</listitem>
</varlistentry>

<para><emphasis>### Grabs/Keyboard-Shortcuts ###</emphasis></para>
<varlistentry>
<term><option>grab-scroll-up</option></term>
Expand Down
2 changes: 1 addition & 1 deletion meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ systemdsystemunitdir = systemd_deps.get_variable('systemdsystemunitdir', default
fs = import('fs')

xkbcommon_deps = dependency('xkbcommon', version: '>=0.5.0')
libtsm_deps = dependency('libtsm', version: '>=4.1.0')
libtsm_deps = dependency('libtsm', version: '>=4.3.0')
libudev_deps = dependency('libudev', version: '>=172')
dl_deps = dependency('dl')
threads_deps = dependency('threads')
Expand Down
3 changes: 3 additions & 0 deletions src/kmscon_conf.c
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@ static void print_help()
"\t Initial delay for key-repeat in ms\n"
"\t --xkb-repeat-rate <msecs> [50]\n"
"\t Delay between two key repeats in ms\n"
"\t --mouse [off]\n"
"\t Enable experimental mouse support\n"
"\n"
"Grabs / Keyboard-Shortcuts:\n"
"\t --grab-scroll-up <grab> [<Shift>Up]\n"
Expand Down Expand Up @@ -733,6 +735,7 @@ int kmscon_conf_new(struct conf_ctx **out)
CONF_OPTION_STRING(0, "xkb-compose-file", &conf->xkb_compose_file, ""),
CONF_OPTION_UINT(0, "xkb-repeat-delay", &conf->xkb_repeat_delay, 250),
CONF_OPTION_UINT(0, "xkb-repeat-rate", &conf->xkb_repeat_rate, 50),
CONF_OPTION_BOOL(0, "mouse", &conf->mouse, false),

/* Grabs / Keyboard-Shortcuts */
CONF_OPTION_GRAB(0, "grab-scroll-up", &conf->grab_scroll_up, &def_grab_scroll_up),
Expand Down
2 changes: 2 additions & 0 deletions src/kmscon_conf.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,8 @@ struct kmscon_conf_t {
unsigned int xkb_repeat_delay;
/* keyboard key-repeat rate */
unsigned int xkb_repeat_rate;
/* Enable mouse support */
bool mouse;

/* Grabs / Keyboard-Shortcuts */
/* scroll-up grab */
Expand Down
2 changes: 1 addition & 1 deletion src/kmscon_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@ static void app_monitor_event(struct uterm_monitor *mon,
case UTERM_MONITOR_INPUT:
log_debug("new input device %s on seat %s",
ev->dev_node, seat->name);
kmscon_seat_add_input(seat->seat, ev->dev_node);
kmscon_seat_add_input(seat->seat, ev->dev_node, seat->conf->mouse);
break;
}
break;
Expand Down
12 changes: 6 additions & 6 deletions src/kmscon_seat.c
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,7 @@ static int seat_vt_event(struct uterm_vt *vt, struct uterm_vt_event *ev,
}

static void seat_input_event(struct uterm_input *input,
struct uterm_input_event *ev,
struct uterm_input_key_event *ev,
void *data)
{
struct kmscon_seat *seat = data;
Expand Down Expand Up @@ -766,7 +766,7 @@ int kmscon_seat_new(struct kmscon_seat **out,
if (ret)
goto err_conf;

ret = uterm_input_register_cb(seat->input, seat_input_event, seat);
ret = uterm_input_register_key_cb(seat->input, seat_input_event, seat);
if (ret)
goto err_input;

Expand All @@ -788,7 +788,7 @@ int kmscon_seat_new(struct kmscon_seat **out,
return 0;

err_input_cb:
uterm_input_unregister_cb(seat->input, seat_input_event, seat);
uterm_input_unregister_key_cb(seat->input, seat_input_event, seat);
err_input:
uterm_input_unref(seat->input);
err_conf:
Expand Down Expand Up @@ -834,7 +834,7 @@ void kmscon_seat_free(struct kmscon_seat *seat)
}

uterm_vt_deallocate(seat->vt);
uterm_input_unregister_cb(seat->input, seat_input_event, seat);
uterm_input_unregister_key_cb(seat->input, seat_input_event, seat);
uterm_input_unref(seat->input);
kmscon_conf_free(seat->conf_ctx);
free(seat->name);
Expand Down Expand Up @@ -924,12 +924,12 @@ void kmscon_seat_refresh_display(struct kmscon_seat *seat,
}
}

int kmscon_seat_add_input(struct kmscon_seat *seat, const char *node)
int kmscon_seat_add_input(struct kmscon_seat *seat, const char *node, bool mouse)
{
if (!seat || !node)
return -EINVAL;

uterm_input_add_dev(seat->input, node);
uterm_input_add_dev(seat->input, node, mouse);
return 0;
}

Expand Down
2 changes: 1 addition & 1 deletion src/kmscon_seat.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ void kmscon_seat_remove_display(struct kmscon_seat *seat,
struct uterm_display *disp);
void kmscon_seat_refresh_display(struct kmscon_seat *seat,
struct uterm_display *disp);
int kmscon_seat_add_input(struct kmscon_seat *seat, const char *node);
int kmscon_seat_add_input(struct kmscon_seat *seat, const char *node, bool mouse);
void kmscon_seat_remove_input(struct kmscon_seat *seat, const char *node);

const char *kmscon_seat_get_name(struct kmscon_seat *seat);
Expand Down
Loading