Re: [PATCH 1/2] tty/sysrq: Extend the sysrq_key_table to cover capital letters

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 04. 08. 20, 18:24, Andrzej Pietrasiewicz wrote:
> All slots in sysrq_key_table[] are either used, reserved or at least
> commented with their intended use. This patch adds capital letter versions
> available, which means adding 26 more entries.
> 
> For already existing SysRq operations the user presses Alt-SysRq-<key>, and
> for the newly added ones Alt-Shift-SysRq-<key>.

And on some keyboards Alt-Fn-Shift-SysRq-<key>. Ugh.

...
> @@ -833,8 +873,13 @@ static bool sysrq_handle_keypress(struct sysrq_state *sysrq,
>  
>  	default:
>  		if (sysrq->active && value && value != 2) {
> +			unsigned char c = sysrq_xlate[code];
> +
>  			sysrq->need_reinject = false;
> -			__handle_sysrq(sysrq_xlate[code], true);
> +			if (sysrq->shift_use != KEY_RESERVED)
> +				if (c >= 'a' && c <= 'z')
> +					c &= ~(1 << 5); /* to uppercase */

c = toupper(c);
instead of the whole if.

> +			__handle_sysrq(c, true);
>  		}
>  		break;
>  	}
> 

thanks,
-- 
js
suse labs



[Index of Archives]     [Linux Media Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Linux Wireless Networking]     [Linux Omap]

  Powered by Linux