fortran1984

C++ chyba

Sep 21st, 2019
374
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.15 KB | None | 0 0
  1. #include <iostream>
  2. #include <vector>
  3. #include <functional>
  4. #include <algorithm>
  5. #include <numeric>
  6. #include "Keys.h"
  7.  
  8. using namespace std;
  9.  
  10. typedef function<void(KeyboardShortcut)> KeyboardCallback;
  11. struct KeyboardShortcut
  12. {
  13. private:
  14.     vector<int> _included_keys;
  15.     vector<int> _excluded_keys;
  16. public:
  17.     KeyboardShortcut(
  18.         const vector<int> included_keys,
  19.         const vector<int> excluded_keys = {}
  20.     )
  21.     {
  22.         _included_keys = included_keys;
  23.         _excluded_keys = excluded_keys;
  24.     }
  25.     vector<int> included_keys() const { return _included_keys; };
  26.     vector<int> excluded_keys() const { return _excluded_keys; };
  27. };
  28.  
  29. class CustomSlot
  30. {
  31. private:
  32.     unsigned int _index;
  33.     KeyboardShortcut _copy_shortcut;
  34.     KeyboardShortcut _paste_shortcut;
  35. public:
  36.     CustomSlot(
  37.         const unsigned int index,
  38.         const KeyboardShortcut copy_shortcut,
  39.         const KeyboardShortcut paste_shortcut
  40.     )
  41.     {
  42.         _index = index;
  43.         _copy_shortcut = copy_shortcut;
  44.         _paste_shortcut = paste_shortcut;
  45.     }
  46.     unsigned int index() const { return _index; }
  47.     KeyboardShortcut copy_shortcut() const { return _copy_shortcut; }
  48.     KeyboardShortcut paste_shortcut() const { return _paste_shortcut; }
  49. };
Add Comment
Please, Sign In to add comment