# Re: \[PATCH\] input: change SysRq keycode for systems without SysRq key

- From: Marvin Raaijmakers \<hidden\>
- Date: 2007-08-17 14:35:18 
- List: linux-input
- Page: https://ratatoskr.run/linux-input/2007/08/8908392
- Thread: https://ratatoskr.run/linux-input/2007/07/8907992/t.md

```text
This code doesn't filter out the "status events" right? So that still
needs to be done(?).

- Marvin

On Fri, 2007-08-17 at 12:22 +0200, Jiri Kosina wrote:
> (CCs trimmed a little bit)
> 
> On Fri, 17 Aug 2007, Marvin Raaijmakers wrote:
> 
> > What's the current state of this patch?
> 
> Hi Marvin,
> 
> does the patch below establish the functionality you are looking for? 
> Please note that we do the reporting only for such usages that have the 
> type of EV_KEY.
> 
> 
> diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c
> index 8edbd30..7f4731b 100644
> --- a/drivers/hid/hid-input.c
> +++ b/drivers/hid/hid-input.c
> @@ -888,6 +888,11 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel
>  		set_bit(KEY_VOLUMEDOWN, input->keybit);
>  	}
>  
> +	if (usage->type == EV_KEY) {
> +		set_bit(EV_MSC, input->evbit);
> +		set_bit(MSC_SCAN, input->mscbit);
> +	}
> +
>  	hid_resolv_event(usage->type, usage->code);
>  
>  	dbg_hid_line("\n");
> @@ -991,6 +996,9 @@ void hidinput_hid_event(struct hid_device *hid, struct hid_field *field, struct
>  		return;
>  	}
>  
> +	if (usage->type == EV_KEY && !!test_bit(usage->code, input->key) != value)
> +		input_event(input, EV_MSC, MSC_SCAN, usage->hid);
> +
>  	input_event(input, usage->type, usage->code, value);
>  
>  	if ((field->flags & HID_MAIN_ITEM_RELATIVE) && (usage->type == EV_KEY))
> 
```
