Skip to content

Commit 8fc44a6

Browse files
committed
Much more useful demo
1 parent 88a7856 commit 8fc44a6

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

demo/demo.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ bool check_update(steam_controller::update_event& update)
77
if (update.buttons & static_cast<int>(steam_controller::Button::A))
88
return false;
99

10-
std::cout << "(" << update.right_axis.x << "," << update.right_axis.y << ")" << std::endl;
10+
std::cout << "buttons: 0x" << std::hex << update.buttons << std::dec << " left: (" << update.left_axis.x << "," << update.left_axis.y << ") right: (" << update.right_axis.x << "," << update.right_axis.y << ")" << std::endl;
1111

1212
return true;
1313
}
@@ -16,6 +16,8 @@ void try_opening(steam_controller::context& context, steam_controller::connectio
1616
{
1717

1818
auto controller = context.connect(info, 0, std::chrono::milliseconds(500));
19+
if (!controller)
20+
return;
1921

2022
steam_controller::event event{};
2123

0 commit comments

Comments
 (0)