keys.go 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. package config
  2. type (
  3. NavigationKeys struct {
  4. SelectPrevious string `toml:"select_previous"`
  5. SelectNext string `toml:"select_next"`
  6. SelectFirst string `toml:"select_first"`
  7. SelectLast string `toml:"select_last"`
  8. }
  9. Keys struct {
  10. FocusGuildsTree string `toml:"focus_guilds_tree"`
  11. FocusMessagesText string `toml:"focus_messages_text"`
  12. FocusMessageInput string `toml:"focus_message_input"`
  13. ToggleGuildsTree string `toml:"toggle_guilds_tree"`
  14. GuildsTree GuildsTreeKeys `toml:"guilds_tree"`
  15. MessagesText MessagesTextKeys `toml:"messages_text"`
  16. MessageInput MessageInputKeys `toml:"message_input"`
  17. Logout string `toml:"logout"`
  18. Quit string `toml:"quit"`
  19. }
  20. GuildsTreeKeys struct {
  21. NavigationKeys
  22. SelectCurrent string `toml:"select_current"`
  23. }
  24. MessagesTextKeys struct {
  25. NavigationKeys
  26. SelectReply string `toml:"select_reply"`
  27. SelectPin string `toml:"select_pin"`
  28. Reply string `toml:"reply"`
  29. ReplyMention string `toml:"reply_mention"`
  30. Delete string `toml:"delete"`
  31. Yank string `toml:"yank"`
  32. Open string `toml:"open"`
  33. }
  34. MessageInputKeys struct {
  35. Send string `toml:"send"`
  36. Editor string `toml:"editor"`
  37. Cancel string `toml:"cancel"`
  38. }
  39. )
  40. func defaultKeys() Keys {
  41. return Keys{
  42. FocusGuildsTree: "Ctrl+G",
  43. FocusMessagesText: "Ctrl+T",
  44. FocusMessageInput: "Ctrl+P",
  45. ToggleGuildsTree: "Ctrl+B",
  46. Logout: "Ctrl+D",
  47. Quit: "Ctrl+C",
  48. GuildsTree: GuildsTreeKeys{
  49. NavigationKeys: NavigationKeys{
  50. SelectPrevious: "Rune[k]",
  51. SelectNext: "Rune[j]",
  52. SelectFirst: "Rune[g]",
  53. SelectLast: "Rune[G]",
  54. },
  55. SelectCurrent: "Enter",
  56. },
  57. MessagesText: MessagesTextKeys{
  58. NavigationKeys: NavigationKeys{
  59. SelectPrevious: "Rune[k]",
  60. SelectNext: "Rune[j]",
  61. SelectFirst: "Rune[g]",
  62. SelectLast: "Rune[G]",
  63. },
  64. SelectReply: "Rune[s]",
  65. SelectPin: "Rune[p]",
  66. Reply: "Rune[r]",
  67. ReplyMention: "Rune[R]",
  68. Delete: "Rune[d]",
  69. Yank: "Rune[y]",
  70. Open: "Rune[o]",
  71. },
  72. MessageInput: MessageInputKeys{
  73. Send: "Enter",
  74. Editor: "Ctrl+E",
  75. Cancel: "Esc",
  76. },
  77. }
  78. }