No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

switch_config.py 1.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. """
  2. SnakeSwitch Configuration
  3. =========================
  4. This file should define a dictionary called LAYOUTS.
  5. The keys of this dictionary should be integers corresponding to
  6. NeoTrelllis button numbers, 0-15. Values may be either a
  7. dictionary defining a layout, or a tuple containing keycodes
  8. to fire immediately.
  9. """
  10. from adafruit_hid.keycode import Keycode
  11. # Define a modifier key here for easy changing if window manager
  12. # configuration changes - this is the Windows key on most keyboards:
  13. MOD_KEY = Keycode.LEFT_GUI
  14. LAYOUTS = {
  15. # A default layout - just the modifier key on the 0th switch:
  16. 0: {
  17. 0: MOD_KEY,
  18. },
  19. # The second button toggles left and right arrows on the other two
  20. # switches:
  21. 1: {
  22. 1: Keycode.LEFT_ARROW,
  23. 2: Keycode.RIGHT_ARROW,
  24. },
  25. # The third button toggles chorded mod-left, mod-right - workspace
  26. # switching in my XMonad setup:
  27. 2: {
  28. 1: (MOD_KEY, Keycode.LEFT_ARROW),
  29. 2: (MOD_KEY, Keycode.RIGHT_ARROW),
  30. },
  31. 3: {
  32. 1: Keycode.PAGE_UP,
  33. 2: Keycode.PAGE_DOWN,
  34. },
  35. # These add some common chords to the primary mod key if used
  36. # in combination with layout 0:
  37. # Mod-Shift-G - brings up a list of active windows:
  38. 4: {
  39. 0: (Keycode.SHIFT, Keycode.G)
  40. },
  41. # Add this for mod-tab:
  42. 5: {
  43. 0: Keycode.TAB
  44. },
  45. # Instead of toggling layouts for the footswitches, pressing and
  46. # releasing buttons 8-15 will instantly fire keyboard events, in
  47. # this case switching between workspaces:
  48. 15: (MOD_KEY, Keycode.ONE),
  49. 14: (MOD_KEY, Keycode.TWO),
  50. 13: (MOD_KEY, Keycode.THREE),
  51. 12: (MOD_KEY, Keycode.FOUR),
  52. 11: (MOD_KEY, Keycode.FIVE),
  53. 10: (MOD_KEY, Keycode.SIX),
  54. 9: (MOD_KEY, Keycode.SEVEN),
  55. # Toggle note window:
  56. 8: (MOD_KEY, Keycode.SHIFT, Keycode.N)
  57. }