Skip to content

Commit

Permalink
Rename Touchstrip in the tablet files to just Strip
Browse files Browse the repository at this point in the history
Make this a consistent naming, same as Rings and Dials
  • Loading branch information
whot committed Mar 5, 2025
1 parent 70ddd89 commit 82464fc
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 31 deletions.
6 changes: 3 additions & 3 deletions data/wacom-cintiq-21ux2.tablet
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,12 @@ IntegratedIn=Display
Stylus=true
NumRings=0
NumStrips=2
StatusLEDs=Touchstrip2;Touchstrip
StatusLEDs=Strip2;Strip

[Buttons]
Left=B;C;D;E;A;F;G;H;I
Right=K;L;M;N;J;O;P;Q;R

Touchstrip=A
Touchstrip2=J
Strip=A
Strip2=J
StripsNumModes=4
4 changes: 2 additions & 2 deletions data/wacom-cintiq-22hd.tablet
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ NumStrips=2
Left=B;C;D;E;A;F;G;H;I
Right=K;L;M;N;J;O;P;Q;R

Touchstrip=A
Touchstrip2=J
Strip=A
Strip2=J
# Note: no physical LEDs to show mode
StripsNumModes=4
4 changes: 2 additions & 2 deletions data/wacom-cintiq-22hdt.tablet
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ NumStrips=2
Left=B;C;D;E;A;F;G;H;I
Right=K;L;M;N;J;O;P;Q;R

Touchstrip=A
Touchstrip2=J
Strip=A
Strip2=J
# Note: no physical LEDs to show mode
StripsNumModes=4
4 changes: 2 additions & 2 deletions data/wacom.example
Original file line number Diff line number Diff line change
Expand Up @@ -218,8 +218,8 @@ Ring2NumModes=3

# If the touchstrips have mode toggling through a button
# like on the Cintiq 21UX2
Touchstrip=A
Touchstrip2=J
Strip=A
Strip2=J
# We assume the same number of modes for each of the touchstrips
# if there is more than one
StripsNumModes=4
Expand Down
8 changes: 4 additions & 4 deletions libwacom/libwacom-database.c
Original file line number Diff line number Diff line change
Expand Up @@ -426,8 +426,8 @@ static const struct {
{ "Bottom", WACOM_BUTTON_POSITION_BOTTOM },
{ "Ring", WACOM_BUTTON_RING_MODESWITCH },
{ "Ring2", WACOM_BUTTON_RING2_MODESWITCH },
{ "Touchstrip", WACOM_BUTTON_TOUCHSTRIP_MODESWITCH },
{ "Touchstrip2", WACOM_BUTTON_TOUCHSTRIP2_MODESWITCH },
{ "Strip", WACOM_BUTTON_TOUCHSTRIP_MODESWITCH },
{ "Strip2", WACOM_BUTTON_TOUCHSTRIP2_MODESWITCH },
{ "OLEDs", WACOM_BUTTON_OLED },
{ "Dial", WACOM_BUTTON_DIAL_MODESWITCH },
{ "Dial2", WACOM_BUTTON_DIAL2_MODESWITCH },
Expand All @@ -439,8 +439,8 @@ static const struct {
} supported_leds[] = {
{ "Ring", WACOM_STATUS_LED_RING },
{ "Ring2", WACOM_STATUS_LED_RING2 },
{ "Touchstrip", WACOM_STATUS_LED_TOUCHSTRIP },
{ "Touchstrip2", WACOM_STATUS_LED_TOUCHSTRIP2 },
{ "Strip", WACOM_STATUS_LED_TOUCHSTRIP },
{ "Strip2", WACOM_STATUS_LED_TOUCHSTRIP2 },
{ "Dial", WACOM_STATUS_LED_DIAL },
{ "Dial2", WACOM_STATUS_LED_DIAL2 },
};
Expand Down
8 changes: 4 additions & 4 deletions libwacom/libwacom.c
Original file line number Diff line number Diff line change
Expand Up @@ -909,8 +909,8 @@ static void print_supported_leds (int fd, const WacomDevice *device)
char *leds_name[] = {
"Ring;",
"Ring2;",
"Touchstrip;",
"Touchstrip2;"
"Strip;",
"Strip2;"
};
int num_leds;
const WacomStatusLEDs *status_leds;
Expand Down Expand Up @@ -981,8 +981,8 @@ static void print_buttons_for_device (int fd, const WacomDevice *device)
print_button_flag_if(fd, device, "Right", WACOM_BUTTON_POSITION_RIGHT);
print_button_flag_if(fd, device, "Top", WACOM_BUTTON_POSITION_TOP);
print_button_flag_if(fd, device, "Bottom", WACOM_BUTTON_POSITION_BOTTOM);
print_button_flag_if(fd, device, "Touchstrip", WACOM_BUTTON_TOUCHSTRIP_MODESWITCH);
print_button_flag_if(fd, device, "Touchstrip2", WACOM_BUTTON_TOUCHSTRIP2_MODESWITCH);
print_button_flag_if(fd, device, "Strip", WACOM_BUTTON_TOUCHSTRIP_MODESWITCH);
print_button_flag_if(fd, device, "Strip2", WACOM_BUTTON_TOUCHSTRIP2_MODESWITCH);
print_button_flag_if(fd, device, "Dial", WACOM_BUTTON_DIAL_MODESWITCH);
print_button_flag_if(fd, device, "OLEDs", WACOM_BUTTON_OLED);
print_button_flag_if(fd, device, "Ring", WACOM_BUTTON_RING_MODESWITCH);
Expand Down
22 changes: 8 additions & 14 deletions test/test_libwacom.py
Original file line number Diff line number Diff line change
Expand Up @@ -604,23 +604,20 @@ def test_new_from_path_unknown_device(db, fallback, bustype):

@pytest.mark.parametrize(
"feature",
("Ring", "Touchstrip", "Dial"),
("Ring", "Strip", "Dial"),
)
@pytest.mark.parametrize("count", (1, 2))
def test_button_modeswitch(custom_datadir, feature, count):
USBID = (0x1234, 0x5678)

# sigh, Touchstrip but StripsNumModes...
num_mode_key = f"{feature}s" if feature != "Touchstrip" else "Strip"

extra = {
"Buttons": {
"Left": "A;B;C;",
"Right": "D;E;F;",
feature: "A",
},
"Features": {
num_mode_key: 4,
f"{feature}s": 4,
},
}
if count > 1:
Expand All @@ -639,7 +636,7 @@ def test_button_modeswitch(custom_datadir, feature, count):

expected_flag = {
"Ring": WacomDevice.ButtonFlags.RING_MODESWITCH,
"Touchstrip": WacomDevice.ButtonFlags.TOUCHSTRIP_MODESWITCH,
"Strip": WacomDevice.ButtonFlags.TOUCHSTRIP_MODESWITCH,
"Dial": WacomDevice.ButtonFlags.DIAL_MODESWITCH,
}[feature]

Expand All @@ -652,7 +649,7 @@ def test_button_modeswitch(custom_datadir, feature, count):

expected_flag = {
"Ring": WacomDevice.ButtonFlags.RING2_MODESWITCH,
"Touchstrip": WacomDevice.ButtonFlags.TOUCHSTRIP2_MODESWITCH,
"Strip": WacomDevice.ButtonFlags.TOUCHSTRIP2_MODESWITCH,
"Dial": WacomDevice.ButtonFlags.DIAL2_MODESWITCH,
}[feature]

Expand All @@ -669,15 +666,12 @@ def test_button_modeswitch(custom_datadir, feature, count):

@pytest.mark.parametrize(
"feature",
("Ring", "Touchstrip", "Dial"),
("Ring", "Strip", "Dial"),
)
@pytest.mark.parametrize("count", (1, 2))
def test_status_leds(custom_datadir, feature, count):
USBID = (0x1234, 0x5678)

# sigh, Touchstrip but StripsNumModes...
num_mode_key = f"{feature}s" if feature != "Touchstrip" else "Strip"

extra = {
"Buttons": {
"Left": "A;B;C;",
Expand All @@ -686,7 +680,7 @@ def test_status_leds(custom_datadir, feature, count):
},
"Features": {
"StatusLEDs": f"{feature};{feature}2" if count > 1 else f"{feature}",
num_mode_key: 4,
f"{feature}s": 4,
},
}
if count > 1:
Expand All @@ -706,7 +700,7 @@ def test_status_leds(custom_datadir, feature, count):
expected = [
{
"Ring": WacomStatusLed.RING,
"Touchstrip": WacomStatusLed.TOUCHSTRIP,
"Strip": WacomStatusLed.TOUCHSTRIP,
"Dial": WacomStatusLed.DIAL,
}[feature]
]
Expand All @@ -715,7 +709,7 @@ def test_status_leds(custom_datadir, feature, count):
expected.append(
{
"Ring": WacomStatusLed.RING2,
"Touchstrip": WacomStatusLed.TOUCHSTRIP2,
"Strip": WacomStatusLed.TOUCHSTRIP2,
"Dial": WacomStatusLed.DIAL2,
}[feature]
)
Expand Down

0 comments on commit 82464fc

Please sign in to comment.