keys.go 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  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. YankID string `toml:"yank_id"`
  24. CollapseParentNode string `toml:"collapse_parent_node"`
  25. MoveToParentNode string `toml:"move_to_parent_node"`
  26. }
  27. MessagesTextKeys struct {
  28. NavigationKeys
  29. SelectReply string `toml:"select_reply"`
  30. SelectPin string `toml:"select_pin"`
  31. Reply string `toml:"reply"`
  32. ReplyMention string `toml:"reply_mention"`
  33. Cancel string `toml:"cancel"`
  34. Delete string `toml:"delete"`
  35. Open string `toml:"open"`
  36. YankContent string `toml:"yank_content"`
  37. YankURL string `toml:"yank_url"`
  38. YankID string `toml:"yank_id"`
  39. }
  40. MessageInputKeys struct {
  41. Send string `toml:"send"`
  42. Editor string `toml:"editor"`
  43. Cancel string `toml:"cancel"`
  44. }
  45. )
  46. func defaultKeys() Keys {
  47. return Keys{
  48. FocusGuildsTree: "Ctrl+G",
  49. FocusMessagesText: "Ctrl+T",
  50. FocusMessageInput: "Ctrl+P",
  51. ToggleGuildsTree: "Ctrl+B",
  52. Logout: "Ctrl+D",
  53. Quit: "Ctrl+C",
  54. GuildsTree: GuildsTreeKeys{
  55. NavigationKeys: NavigationKeys{
  56. SelectPrevious: "Rune[k]",
  57. SelectNext: "Rune[j]",
  58. SelectFirst: "Rune[g]",
  59. SelectLast: "Rune[G]",
  60. },
  61. SelectCurrent: "Enter",
  62. YankID: "Rune[i]",
  63. CollapseParentNode: "Rune[-]",
  64. MoveToParentNode: "Rune[p]",
  65. },
  66. MessagesText: MessagesTextKeys{
  67. NavigationKeys: NavigationKeys{
  68. SelectPrevious: "Rune[k]",
  69. SelectNext: "Rune[j]",
  70. SelectFirst: "Rune[g]",
  71. SelectLast: "Rune[G]",
  72. },
  73. SelectReply: "Rune[s]",
  74. SelectPin: "Rune[p]",
  75. Reply: "Rune[r]",
  76. ReplyMention: "Rune[R]",
  77. Cancel: "Esc",
  78. Delete: "Rune[d]",
  79. Open: "Rune[o]",
  80. YankContent: "Rune[y]",
  81. YankURL: "Rune[u]",
  82. YankID: "Rune[i]",
  83. },
  84. MessageInput: MessageInputKeys{
  85. Send: "Enter",
  86. Editor: "Ctrl+E",
  87. Cancel: "Esc",
  88. },
  89. }
  90. }