From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8468820FABF for ; Tue, 4 Feb 2025 13:13:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738674817; cv=none; b=gYrjmY4e7BIZIgeDQMNadF5DXcJYVVLEAjotaJtAoIRtLu+rwc7C/HD3qzXCt0GYazMIGoz7dUL5swKstao4ZaK4FLRX64Pc5t41A4xs2ZrQGK+fZYQeeyCbDwabqW1kc0Us21UeippoMYGSKVml5U7OWzRHsBp64+8xUABpEZ8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738674817; c=relaxed/simple; bh=hvvJpb5Y9NI4FW8wTF8eRVKPQKHGSiOz/7dhkmadFAg=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=J4vaAGM2xR7x6cG+BQ0ow7W217vzCtfCq1NxdJUNzJCwPWxkxrii7ZX6oPxxqYU1V6xHv4CVm4FXZ63ttNp1o2hsgIjp7Xn/c9X//lU2j35reTq7c4wnSaU1ywZ+RSnCvCjBF15w7ZEs5EE3MEuPEjVEFBmRr460G4I1Xx7zWjI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=LnJwgb4c; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="LnJwgb4c" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 39D9BC4CEDF; Tue, 4 Feb 2025 13:13:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1738674816; bh=hvvJpb5Y9NI4FW8wTF8eRVKPQKHGSiOz/7dhkmadFAg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=LnJwgb4cZHeMHeoxjcNaD9OsR5h99LLDp7+rCI7Y/AfClnOGkJVayeml/PWf/nw/t slbsY8p06M03FP0Zsm80WCcKex7ycWFD9T8p4GxCHs/T1bacasjXsezOToCIgOdUEi HtXQrlvxptY/WafD8EjdtSshgGTdxGBbdHo4q3v+J7jVqcMPydj/x17h4E0cvxjcje miylaW3I8QnY+qRqGWdJLfb3EDeUMhJJde4hSaL0EOJKgEM3qYBN5i09pJvHcg//EA GrnlVKu7cTWR1v2+CfmywAzG0ayOhmuAw3t+zb73vVy2RMELtrnrOXaSB6RHpHYz7l GPI5VFRxz5K+Q== Date: Tue, 4 Feb 2025 14:13:28 +0100 From: Alexey Gladkov To: shrik3@mailbox.org Cc: kbd@lists.linux.dev Subject: Re: [PATCH] kbd_mode: support Disabled mode (K_OFF) Message-ID: References: <20250203175118.30479-1-shrik3@mailbox.org> Precedence: bulk X-Mailing-List: kbd@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20250203175118.30479-1-shrik3@mailbox.org> On Mon, Feb 03, 2025 at 06:47:31PM +0100, shrik3@mailbox.org wrote: > From: Tianhao Wang > > Since linux 2.6.39 KDGKBMODE could have K_OFF (0x04), the Disabled mode. > This may be set by e.g. Xorg that doesn't read /dev/tty > > Reference: https://lore.kernel.org/all/AANLkTikZe1EuvNQHceNUdKFpmmeAbQG8H+34AG9fw43u@mail.gmail.com/ > > Signed-off-by: Tianhao Wang Applied. Thanks. > --- > src/kbd_mode.c | 10 ++++++++++ > 1 file changed, 10 insertions(+) > > diff --git a/src/kbd_mode.c b/src/kbd_mode.c > index 9a4aff3..f37c321 100644 > --- a/src/kbd_mode.c > +++ b/src/kbd_mode.c > @@ -16,9 +16,14 @@ > #include > #include > #include > +#include > > #include "libcommon.h" > > +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 39) > +#define HAS_K_OFF > +#endif > + > static void KBD_ATTR_NORETURN > usage(int rc, const struct kbd_help *options) > { > @@ -48,6 +53,11 @@ fprint_mode(FILE *stream, int mode) > case K_UNICODE: > fprintf(stream, _("The keyboard is in Unicode (UTF-8) mode")); > break; > +#ifdef HAS_K_OFF > + case K_OFF: > + fprintf(stream, _("The keyboard is in Disabled mode, perhaps you are using a graphical environment?")); > + break; > +#endif > default: > fprintf(stream, _("The keyboard is in some unknown mode")); > } > -- > 2.48.1 > > -- Rgrds, legion