Skip to content

Commit

Permalink
chore: rebase fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Hazer committed Jun 20, 2024
1 parent 757e43c commit 5188aa1
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 20 deletions.
10 changes: 5 additions & 5 deletions src/input/gamepad.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ namespace input::gamepad {

void
free_gamepad(platf::input_t &platf_input, int id) {
platf::gamepad(platf_input, id, platf::gamepad_state_t {});
platf::gamepad_update(platf_input, id, platf::gamepad_state_t {});
platf::free_gamepad(platf_input, id);

Check warning on line 36 in src/input/gamepad.cpp

View check run for this annotation

Codecov / codecov/patch

src/input/gamepad.cpp#L34-L36

Added lines #L34 - L36 were not covered by tests

free_id(gamepadMask, id);

Check warning on line 38 in src/input/gamepad.cpp

View check run for this annotation

Codecov / codecov/patch

src/input/gamepad.cpp#L38

Added line #L38 was not covered by tests
Expand Down Expand Up @@ -313,18 +313,18 @@ namespace input::gamepad {
// Force the back button up
gamepad.back_button_state = button_state_e::UP;
state.buttonFlags &= ~platf::BACK;
platf::gamepad(PlatformInput::getInstance(), gamepad.id, state);
platf::gamepad_update(PlatformInput::getInstance(), gamepad.id, state);

Check warning on line 316 in src/input/gamepad.cpp

View check run for this annotation

Codecov / codecov/patch

src/input/gamepad.cpp#L314-L316

Added lines #L314 - L316 were not covered by tests

// Press Home button
state.buttonFlags |= platf::HOME;
platf::gamepad(PlatformInput::getInstance(), gamepad.id, state);
platf::gamepad_update(PlatformInput::getInstance(), gamepad.id, state);

Check warning on line 320 in src/input/gamepad.cpp

View check run for this annotation

Codecov / codecov/patch

src/input/gamepad.cpp#L319-L320

Added lines #L319 - L320 were not covered by tests

// Sleep for a short time to allow the input to be detected
std::this_thread::sleep_for(std::chrono::milliseconds(100));

Check warning on line 323 in src/input/gamepad.cpp

View check run for this annotation

Codecov / codecov/patch

src/input/gamepad.cpp#L323

Added line #L323 was not covered by tests

// Release Home button
state.buttonFlags &= ~platf::HOME;
platf::gamepad(PlatformInput::getInstance(), gamepad.id, state);
platf::gamepad_update(PlatformInput::getInstance(), gamepad.id, state);

Check warning on line 327 in src/input/gamepad.cpp

View check run for this annotation

Codecov / codecov/patch

src/input/gamepad.cpp#L326-L327

Added lines #L326 - L327 were not covered by tests

gamepad.back_timeout_id = nullptr;
};

Check warning on line 330 in src/input/gamepad.cpp

View check run for this annotation

Codecov / codecov/patch

src/input/gamepad.cpp#L329-L330

Added lines #L329 - L330 were not covered by tests
Expand All @@ -338,7 +338,7 @@ namespace input::gamepad {
}
}

platf::gamepad(PlatformInput::getInstance(), gamepad.id, gamepad_state);
platf::gamepad_update(PlatformInput::getInstance(), gamepad.id, gamepad_state);

Check warning on line 341 in src/input/gamepad.cpp

View check run for this annotation

Codecov / codecov/patch

src/input/gamepad.cpp#L341

Added line #L341 was not covered by tests

gamepad.gamepad_state = gamepad_state;

Check warning on line 343 in src/input/gamepad.cpp

View check run for this annotation

Codecov / codecov/patch

src/input/gamepad.cpp#L343

Added line #L343 was not covered by tests
}
Expand Down
16 changes: 8 additions & 8 deletions src/input/keyboard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -154,28 +154,28 @@ namespace input::keyboard {
if (!release) {
// Press any synthetic modifiers required for this key
if (synthetic_modifiers & MODIFIER_SHIFT) {
platf::keyboard(PlatformInput::getInstance(), VKEY_SHIFT, false, flags);
platf::keyboard_update(PlatformInput::getInstance(), VKEY_SHIFT, false, flags);

Check warning on line 157 in src/input/keyboard.cpp

View check run for this annotation

Codecov / codecov/patch

src/input/keyboard.cpp#L157

Added line #L157 was not covered by tests
}
if (synthetic_modifiers & MODIFIER_CTRL) {
platf::keyboard(PlatformInput::getInstance(), VKEY_CONTROL, false, flags);
platf::keyboard_update(PlatformInput::getInstance(), VKEY_CONTROL, false, flags);

Check warning on line 160 in src/input/keyboard.cpp

View check run for this annotation

Codecov / codecov/patch

src/input/keyboard.cpp#L160

Added line #L160 was not covered by tests
}
if (synthetic_modifiers & MODIFIER_ALT) {
platf::keyboard(PlatformInput::getInstance(), VKEY_MENU, false, flags);
platf::keyboard_update(PlatformInput::getInstance(), VKEY_MENU, false, flags);

Check warning on line 163 in src/input/keyboard.cpp

View check run for this annotation

Codecov / codecov/patch

src/input/keyboard.cpp#L163

Added line #L163 was not covered by tests
}
}

platf::keyboard(PlatformInput::getInstance(), map_keycode(key_code), release, flags);
platf::keyboard_update(PlatformInput::getInstance(), map_keycode(key_code), release, flags);

Check warning on line 167 in src/input/keyboard.cpp

View check run for this annotation

Codecov / codecov/patch

src/input/keyboard.cpp#L167

Added line #L167 was not covered by tests

if (!release) {
// Raise any synthetic modifier keys we pressed
if (synthetic_modifiers & MODIFIER_SHIFT) {
platf::keyboard(PlatformInput::getInstance(), VKEY_SHIFT, true, flags);
platf::keyboard_update(PlatformInput::getInstance(), VKEY_SHIFT, true, flags);

Check warning on line 172 in src/input/keyboard.cpp

View check run for this annotation

Codecov / codecov/patch

src/input/keyboard.cpp#L172

Added line #L172 was not covered by tests
}
if (synthetic_modifiers & MODIFIER_CTRL) {
platf::keyboard(PlatformInput::getInstance(), VKEY_CONTROL, true, flags);
platf::keyboard_update(PlatformInput::getInstance(), VKEY_CONTROL, true, flags);

Check warning on line 175 in src/input/keyboard.cpp

View check run for this annotation

Codecov / codecov/patch

src/input/keyboard.cpp#L175

Added line #L175 was not covered by tests
}
if (synthetic_modifiers & MODIFIER_ALT) {
platf::keyboard(PlatformInput::getInstance(), VKEY_MENU, true, flags);
platf::keyboard_update(PlatformInput::getInstance(), VKEY_MENU, true, flags);

Check warning on line 178 in src/input/keyboard.cpp

View check run for this annotation

Codecov / codecov/patch

src/input/keyboard.cpp#L178

Added line #L178 was not covered by tests
}
}
}
Expand Down Expand Up @@ -268,7 +268,7 @@ namespace input::keyboard {
// already released
continue;

Check warning on line 269 in src/input/keyboard.cpp

View check run for this annotation

Codecov / codecov/patch

src/input/keyboard.cpp#L269

Added line #L269 was not covered by tests
}
platf::keyboard(platf_input, vk_from_kpid(kp.first) & 0x00FF, true, flags_from_kpid(kp.first));
platf::keyboard_update(platf_input, vk_from_kpid(kp.first) & 0x00FF, true, flags_from_kpid(kp.first));
key_press[kp.first] = false;

Check warning on line 272 in src/input/keyboard.cpp

View check run for this annotation

Codecov / codecov/patch

src/input/keyboard.cpp#L271-L272

Added lines #L271 - L272 were not covered by tests
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/input/pen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ namespace input::pen {
contact_area.second,

Check warning on line 105 in src/input/pen.cpp

View check run for this annotation

Codecov / codecov/patch

src/input/pen.cpp#L99-L105

Added lines #L99 - L105 were not covered by tests
};

platf::pen(input->client_context.get(), abs_port, pen);
platf::pen_update(input->client_context.get(), abs_port, pen);

Check warning on line 108 in src/input/pen.cpp

View check run for this annotation

Codecov / codecov/patch

src/input/pen.cpp#L108

Added line #L108 was not covered by tests
}

/**
Expand Down
4 changes: 2 additions & 2 deletions src/input/processor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -274,8 +274,8 @@ namespace input {

bool
probe_gamepads() {
auto input = static_cast<platf::input_t *>(platf_input.get());
const auto gamepads = platf::supported_gamepads(input);
platf::input_t &input = PlatformInput::getInstance();
const auto gamepads = platf::supported_gamepads(reinterpret_cast<platf::input_t *>(&input));

Check warning on line 278 in src/input/processor.cpp

View check run for this annotation

Codecov / codecov/patch

src/input/processor.cpp#L276-L278

Added lines #L276 - L278 were not covered by tests
for (auto &gamepad : gamepads) {
if (gamepad.is_enabled && gamepad.name != "auto") {
return false;

Check warning on line 281 in src/input/processor.cpp

View check run for this annotation

Codecov / codecov/patch

src/input/processor.cpp#L281

Added line #L281 was not covered by tests
Expand Down
2 changes: 1 addition & 1 deletion src/input/touch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ namespace input::touch {
contact_area.second,
};

Check warning on line 112 in src/input/touch.cpp

View check run for this annotation

Codecov / codecov/patch

src/input/touch.cpp#L107-L112

Added lines #L107 - L112 were not covered by tests

platf::touch(input->client_context.get(), abs_port, touch);
platf::touch_update(input->client_context.get(), abs_port, touch);

Check warning on line 114 in src/input/touch.cpp

View check run for this annotation

Codecov / codecov/patch

src/input/touch.cpp#L114

Added line #L114 was not covered by tests
}

/**
Expand Down
3 changes: 2 additions & 1 deletion src/platform/macos/input.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
* @file src/platform/macos/input.cpp
* @brief todo
*/
#include "src/input.h"
#include "src/input/common.h"
#include "src/input/processor.h"

#import <Carbon/Carbon.h>
#include <chrono>
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_httpcommon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* @file tests/test_httpcommon.cpp
* @brief Test src/httpcommon.*.
*/
#include <src/httpcommon.h>
#include <src/server/httpcommon.h>

#include <tests/conftest.cpp>

Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_mouse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* @file tests/unit/test_mouse.cpp
* @brief Test src/input.*.
*/
#include <src/input.h>
#include <src/input/common.h>
#include <src/platform/common.h>

#include <tests/conftest.cpp>
Expand Down

0 comments on commit 5188aa1

Please sign in to comment.