diff --git a/examples/AB Shutter3 b/examples/AB Shutter3 new file mode 100644 index 0000000..b1ce0a8 --- /dev/null +++ b/examples/AB Shutter3 @@ -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 diff --git a/src/btpt.cc b/src/btpt.cc index c1b86a5..bddd147 100644 --- a/src/btpt.cc +++ b/src/btpt.cc @@ -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 parts = line.split(" ", QString::SkipEmptyParts); if (parts.size() != 4) { nh_log("invalid config line: %s",