Skip to content

Commit a0cdc95

Browse files
authored
fix indentation and don't use [=] captures in readme
1 parent 0809fa8 commit a0cdc95

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ using namespace keybinds;
8181
bool MyLayer::init() {
8282
...
8383

84-
this->addEventListener<InvokeBindFilter>([=](InvokeBindEvent* event) {
84+
this->addEventListener<InvokeBindFilter>([this](InvokeBindEvent* event) {
8585
if (event->isDown()) {
8686
// do a backflip!
8787
}
@@ -91,7 +91,7 @@ bool MyLayer::init() {
9191
}, "backflip"_spr);
9292

9393
// optional api version
94-
this->addEventListener<InvokeBindFilterV2>([=](InvokeBindEventV2* event) {
94+
this->addEventListener<InvokeBindFilterV2>([this](InvokeBindEventV2* event) {
9595
if (event->isDown()) {
9696
// do a backflip!
9797
}
@@ -118,15 +118,15 @@ You can listen for global keybinds via an `$execute` block:
118118
using namespace keybinds;
119119

120120
$execute {
121-
new EventListener([=](InvokeBindEvent* event) {
122-
// do stuff
123-
return ListenerResult::Propagate;
121+
new EventListener([](InvokeBindEvent* event) {
122+
// do stuff
123+
return ListenerResult::Propagate;
124124
}, InvokeBindFilter(nullptr, "event-id"));
125125

126126
// optional api version
127-
new EventListener([=](InvokeBindEventV2* event) {
128-
// do stuff
129-
return ListenerResult::Propagate;
127+
new EventListener([](InvokeBindEventV2* event) {
128+
// do stuff
129+
return ListenerResult::Propagate;
130130
}, InvokeBindFilterV2(nullptr, "event-id"));
131131
}
132132
```
@@ -229,7 +229,7 @@ Once you have figured out how to get inputs from your awesome toaster, you need
229229
```cpp
230230
void XInput_onGamingToasterCallback(double temp, int bread) {
231231
// Make sure all bind events are only ever posted in the GD thread !!!!
232-
Loader::get()->queueInMainThread([=] {
232+
Loader::get()->queueInMainThread([temp, bread] {
233233
PressBindEvent(ToasterBind::create(static_cast<float>(temp), bread), true).post();
234234
});
235235
}

0 commit comments

Comments
 (0)