File: quartz.cpp

package info (click to toggle)
higan 098-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 11,904 kB
  • ctags: 13,286
  • sloc: cpp: 108,285; ansic: 778; makefile: 32; sh: 18
file content (43 lines) | stat: -rw-r--r-- 944 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#include "keyboard/quartz.cpp"

struct InputQuartz : Input {
  InputKeyboardQuartz quartzKeyboard;
  InputQuartz() : quartzKeyboard(*this) {}
  ~InputQuartz() { term(); }

  auto cap(const string& name) -> bool {
    if(name == Input::KeyboardSupport) return true;
    return false;
  }

  auto get(const string& name) -> any {
    return {};
  }

  auto set(const string& name, const any& value) -> bool {
    return false;
  }

  auto acquire() -> bool { return false; }
  auto release() -> bool { return false; }
  auto acquired() -> bool { return false; }

  auto poll() -> vector<shared_pointer<HID::Device>> {
    vector<shared_pointer<HID::Device>> devices;
    quartzKeyboard.poll(devices);
    return devices;
  }

  auto rumble(uint64 id, bool enable) -> bool {
    return false;
  }

  auto init() -> bool {
    if(!quartzKeyboard.init()) return false;
    return true;
  }

  auto term() -> void {
    quartzKeyboard.term();
  }
};