MCPcopy Create free account
hub / github.com/danoon2/Boxedwine / takeScreenShot

Method takeScreenShot

source/util/recorder.cpp:103–145  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

101}
102
103void Recorder::takeScreenShot() {
104 bool tracking = false;
105 int x = 0;
106 int y = 0;
107 int w = 0;
108 int h = 0;
109 KNativeScreenPtr screen = KNativeSystem::getScreen();
110 screen->startRecorderScreenShot();
111 screen->getInput()->processCustomEvents([this, &x, &y, &w, &h, screen](bool isKeyDown, int key, bool isF11) {
112 if (isF11) {
113 if (w == 0 || h == 0) {
114 fullScrennShot();
115 } else {
116 partialScreenShot(x, y, w, h);
117 }
118 screen->finishRecorderScreenShot();
119 return false;
120 }
121 return true;
122 }, [&tracking, &x, &y, &w, &h](bool isButtonDown, int button, int mousex, int mousey) {
123 if (isButtonDown) {
124 tracking = true;
125 x = mousex;
126 y = mousey;
127 } else {
128 tracking = false;
129 if (mousex > x)
130 w = mousex - x;
131 if (mousey > y)
132 h = mousey - y;
133 }
134 return true;
135 }, [&tracking, &x, &y, &w, &h, screen](int mousex, int mousey) {
136 if (tracking) {
137 if (mousex > x)
138 w = mousex - x;
139 if (mousey > y)
140 h = mousey - y;
141 screen->drawRectOnPushedSurfaceAndDisplay(x, y, w, h, 0x80, 0x80, 0x80, 0x80);
142 }
143 return true;
144 });
145}
146
147void Recorder::checkInputModifiers() {
148 U32 inputModifers = KNativeSystem::getCurrentInput()->getInputModifiers();

Callers 1

Calls 5

processCustomEventsMethod · 0.80
getInputMethod · 0.80

Tested by

no test coverage detected