feat: support numlock on

This commit is contained in:
DreamMaoMao 2025-03-10 22:38:08 +08:00
parent 360e259ca5
commit aa54758e75
3 changed files with 24 additions and 1 deletions

8
cage.c
View file

@ -61,6 +61,8 @@
#include "xwayland.h"
#endif
extern bool numlock;
void
server_terminate(struct cg_server *server)
{
@ -232,6 +234,7 @@ usage(FILE *file, const char *cage)
" -m extend Extend the display across all connected outputs (default)\n"
" -m last Use only the last connected output\n"
" -s\t Allow VT switching\n"
" -n\t Enable numlock\n"
" -v\t Show the version number and exit\n"
"\n"
" Use -- when you want to pass arguments to APPLICATION\n",
@ -242,7 +245,7 @@ static bool
parse_args(struct cg_server *server, int argc, char *argv[])
{
int c;
while ((c = getopt(argc, argv, "dDhm:sv")) != -1) {
while ((c = getopt(argc, argv, "dDhm:snv")) != -1) {
switch (c) {
case 'd':
server->xdg_decoration = true;
@ -260,6 +263,9 @@ parse_args(struct cg_server *server, int argc, char *argv[])
server->output_mode = CAGE_MULTI_OUTPUT_MODE_EXTEND;
}
break;
case 'n':
numlock = true;
break;
case 's':
server->allow_vt_switch = true;
break;