Advertisement
Guest User

Untitled

a guest
Mar 30th, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.37 KB | None | 0 0
  1. # Note that kbdrate only affects existing keyboards, and HP iLO attaches a new
  2. # USB keyboard when you connect, so you may have to reboot (with the iLO console
  3. # attached) to get the keyboard delay and repeat rate to take effect.
  4.  
  5. [Unit]
  6. Description=Set longer delay time for key repeat
  7.  
  8. [Service]
  9. Type=oneshot
  10. RemainAfterExit=yes
  11. StandardInput=tty
  12. StandardOutput=tty
  13. ExecStart=/sbin/kbdrate -d 1000 -r 2
  14.  
  15. [Install]
  16. WantedBy=multi-user.target
  17. WantedBy=rescue.target
  18.  
  19. From 78c32f539b89bf385985bea47a7058a540d31da0 Mon Sep 17 00:00:00 2001
  20. From: Ivan Kozik <ivan@ludios.org>
  21. Date: Thu, 30 Mar 2017 13:31:17 +0000
  22. Subject: [PATCH] Increase the default keyboard repeat delay from 250ms to
  23. 1000ms and repeat rate from 1000/33 Hz to 1000/500 Hz to avoid unintentional
  24. repeated keystrokes when using remote consoles such as HP iLO over
  25. high-latency links. These consoles (HP iLO included) often transmit key
  26. states (up/down) instead of keystrokes, making it impossible to even enter a
  27. password and log in.
  28.  
  29. Fixing this in the kernel avoids problems with kbdrate where the parameters
  30. passed to kbdrate don't apply to the new keyboards attached by HP iLO.
  31. ---
  32. drivers/input/input.c | 2 +-
  33. drivers/input/keyboard/atkbd.c | 4 ++--
  34. 2 files changed, 3 insertions(+), 3 deletions(-)
  35.  
  36. diff --git a/drivers/input/input.c b/drivers/input/input.c
  37. index 880605959aa6..a195af2d062a 100644
  38. --- a/drivers/input/input.c
  39. +++ b/drivers/input/input.c
  40. @@ -2126,7 +2126,7 @@ int input_register_device(struct input_dev *dev)
  41. * is handled by the driver itself and we don't do it in input.c.
  42. */
  43. if (!dev->rep[REP_DELAY] && !dev->rep[REP_PERIOD])
  44. - input_enable_softrepeat(dev, 250, 33);
  45. + input_enable_softrepeat(dev, 1000, 500);
  46.  
  47. if (!dev->getkeycode)
  48. dev->getkeycode = input_default_getkeycode;
  49. diff --git a/drivers/input/keyboard/atkbd.c b/drivers/input/keyboard/atkbd.c
  50. index ec876b5b1382..9dd04c2215b3 100644
  51. --- a/drivers/input/keyboard/atkbd.c
  52. +++ b/drivers/input/keyboard/atkbd.c
  53. @@ -1096,8 +1096,8 @@ static void atkbd_set_device_attrs(struct atkbd *atkbd)
  54. BIT_MASK(LED_MUTE) | BIT_MASK(LED_MISC);
  55.  
  56. if (!atkbd->softrepeat) {
  57. - input_dev->rep[REP_DELAY] = 250;
  58. - input_dev->rep[REP_PERIOD] = 33;
  59. + input_dev->rep[REP_DELAY] = 1000;
  60. + input_dev->rep[REP_PERIOD] = 500;
  61. }
  62.  
  63. input_dev->mscbit[0] = atkbd->softraw ? BIT_MASK(MSC_SCAN) :
  64. --
  65. 2.11.0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement