Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions examples/AB Shutter3
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Format:
# METHOD TYPE CODE VALUE
#
# COLUMN DEFINITIONS:
# 1. METHOD: The internal Kobo function to call.
# 2. TYPE: The Linux Input Event Type. Usually 'EV_KEY' for buttons or 'EV_ABS' for joysticks.
# 3. CODE: The specific button code. Examples: KEY_VOLUMEUP, KEY_VOLUMEDOWN, BTN_A, BTN_B
# 4. VALUE: The state of the button.
# 1 = Press (Trigger immediately when button goes down)
# 0 = Release (Trigger when button is let go)
# ------------------------------------------------------------------------------
nextPage EV_KEY KEY_VOLUMEUP 0
13 changes: 13 additions & 0 deletions src/btpt.cc
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,19 @@ bool BluetoothPageTurner::addDevice(
*/

QString line = in.readLine();

/* Support for Comments */
/* Remove anything after a '#' character */
line = line.section('#', 0, 0);

/* Remove whitespace from start and end */
line = line.trimmed();

/* If line is now empty, skip it */
if (line.isEmpty()) {
continue;
}

QList<QString> parts = line.split(" ", QString::SkipEmptyParts);
if (parts.size() != 4) {
nh_log("invalid config line: %s",
Expand Down