Skip to content

Commit ccbda05

Browse files
authored
fix for #3485 (#3518)
* Update pendant.cc fixed old issue #987 that wasn't fully patched few versions back some xhc-whb04b-x pendants send different key for one switch * Update pendant.h fixed old issue #987 that wasn't fully patched few versions back some xhc-whb04b-x pendants send different key for one switch
1 parent f219dde commit ccbda05

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

src/hal/user_comps/xhc-whb04b-6/pendant.cc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -332,8 +332,8 @@ FeedRotaryButtonCodes::FeedRotaryButtonCodes() :
332332
percent_30(0x10, "1", "30%"),
333333
percent_60(0x1a, "5", "60%"),
334334
percent_100(0x1b, "10", "100%"),
335-
lead(0x1c, "Lead", ""), // user jasenk2 seem to need 0x9b for xhc-whb06-4 see : https://github.com/LinuxCNC/linuxcnc/pull/987
336-
// solution added in this file for use both know keycodes (0x1c) + Jasenk (0x9b)
335+
lead(0x1c, "Lead", ""), // user jasenk2 seem to need 0x9b for xhc-whb06-4 see : https://github.com/LinuxCNC/linuxcnc/pull/987, zajc3w needs 0x9B for xhc-whb06-6 see: https://github.com/LinuxCNC/linuxcnc/issues/3485
336+
lead9B(0x9B, "Lead", ""), //previous solution ommited line 607 and key code 0x9b was still not recognised
337337
undefined(0x00, "", ""),
338338
codeMap{
339339
{percent_2.code, &percent_2},
@@ -604,7 +604,7 @@ void FeedRotaryButton::update()
604604
return;
605605
}
606606

607-
if (*mKey == KeyCodes::Feed.lead)
607+
if (*mKey == KeyCodes::Feed.lead || *mKey == KeyCodes::Feed.lead9B)
608608
{
609609
mStepSize = mLeadSizeMapper.getStepSize(HandwheelLeadModeStepSize::PositionNameIndex::LEAD);
610610
mIsPermitted = mLeadSizeMapper.isPermitted(HandwheelLeadModeStepSize::PositionNameIndex::LEAD);
@@ -1354,7 +1354,7 @@ void Pendant::onFeedActiveEvent(const KeyCode& feed)
13541354
// ----------------------------------------------------------------------
13551355
void Pendant::dispatchFeedEventToHandwheel(const KeyCode& feed, bool isActive)
13561356
{
1357-
if (feed.code == KeyCodes::Feed.lead.code || feed.code == 0x9b) // user jasenk2 seem to need 0x9b for xhc-whb06-4 see : https://github.com/LinuxCNC/linuxcnc/pull/987
1357+
if (feed.code == KeyCodes::Feed.lead.code || feed.code == KeyCodes::Feed.lead9B.code) // user jasenk2 seem to need 0x9b for xhc-whb06-4 see : https://github.com/LinuxCNC/linuxcnc/pull/987
13581358
{
13591359
mHandWheel.counters().enableLeadCounter(isActive);
13601360
}
@@ -1386,7 +1386,7 @@ void Pendant::dispatchActiveFeedToHal(const KeyCode& feed, bool isActive)
13861386
{
13871387
mHal.setFeedValueSelected100(isActive);
13881388
}
1389-
else if (feed.code == KeyCodes::Feed.lead.code || feed.code == 0x9b) // user jasenk2 seem to need 0x9b for xhc-whb06-4 see : https://github.com/LinuxCNC/linuxcnc/pull/987
1389+
else if (feed.code == KeyCodes::Feed.lead.code || feed.code == KeyCodes::Feed.lead9B.code) // user jasenk2 seem to need 0x9b for xhc-whb06-4 see : https://github.com/LinuxCNC/linuxcnc/pull/987
13901390
{
13911391
mHal.setFeedValueSelectedLead(isActive);
13921392
mCurrentButtonsState.feedButton().setStepMode(HandwheelStepmodes::Mode::MPG);

src/hal/user_comps/xhc-whb04b-6/pendant.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,7 @@ class FeedRotaryButtonCodes
227227
const KeyCode percent_60;
228228
const KeyCode percent_100;
229229
const KeyCode lead;
230+
const KeyCode lead9B;
230231
const KeyCode undefined;
231232
const std::map<uint8_t, const KeyCode*> codeMap;
232233

0 commit comments

Comments
 (0)