Re: m2: add suspend keyboard shortcut

2023-07-08 Thread Tobias Heider
On Sat, Jul 08, 2023 at 07:33:01PM +0200, Tobias Heider wrote: > On Sat, Jul 08, 2023 at 04:06:33PM +, Miod Vallat wrote: > > > Now that we have request_sleep() we can add a new internal KS_Cmd_Sleep > > > keycode, map it into the macbook keyboard, catch in wskbd and go to sleep. > > > > > > o

Re: m2: add suspend keyboard shortcut

2023-07-08 Thread Tobias Heider
On Sat, Jul 08, 2023 at 04:06:33PM +, Miod Vallat wrote: > > Now that we have request_sleep() we can add a new internal KS_Cmd_Sleep > > keycode, map it into the macbook keyboard, catch in wskbd and go to sleep. > > > > ok? > > > --- sys/dev/usb/ukbdmap.c > > +++ sys/dev/usb/ukbdmap.c > > @@

Re: m2: add suspend keyboard shortcut

2023-07-08 Thread Miod Vallat
> Now that we have request_sleep() we can add a new internal KS_Cmd_Sleep > keycode, map it into the macbook keyboard, catch in wskbd and go to sleep. > > ok? > --- sys/dev/usb/ukbdmap.c > +++ sys/dev/usb/ukbdmap.c > @@ -176,6 +176,7 @@ static const keysym_t ukbd_keydesc_us[] = { > KC(127),

Re: m2: add suspend keyboard shortcut

2023-07-08 Thread Theo de Raadt
Tobias Heider wrote: > +#ifdef SUSPEND > + if (ksym == KS_Cmd_Sleep) > + return request_sleep(SLEEP_SUSPEND); > +#endif Oh wait, it is consumed. Is that a problem

Re: m2: add suspend keyboard shortcut

2023-07-08 Thread Theo de Raadt
Tobias Heider wrote: > +#ifdef SUSPEND > + if (ksym == KS_Cmd_Sleep) > + return request_sleep(SLEEP_SUSPEND); > +#endif This key is not absorbed when it performs this action. Is that OK?

Re: m2: add suspend keyboard shortcut

2023-07-08 Thread Mark Kettenis
> Date: Sat, 8 Jul 2023 16:54:25 +0200 > From: Tobias Heider > > Now that we have request_sleep() we can add a new internal KS_Cmd_Sleep > keycode, map it into the macbook keyboard, catch in wskbd and go to sleep. > > ok? Looks good to me, but I'd like to hear what miod@ has to say about this.

m2: add suspend keyboard shortcut

2023-07-08 Thread Tobias Heider
Now that we have request_sleep() we can add a new internal KS_Cmd_Sleep keycode, map it into the macbook keyboard, catch in wskbd and go to sleep. ok? diff 4cfcaa1dc85fba5c0672ef2787341ee6cc639979 16365606ee1145b5ae95e7bb74a7d9a411d0004a commit - 4cfcaa1dc85fba5c0672ef2787341ee6cc639979 commit +