-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add trackpoint device from VoodooTrackpoint
- Loading branch information
Michael Belyaev
committed
Dec 4, 2020
1 parent
0249814
commit c6f2977
Showing
7 changed files
with
179 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
/* | ||
* TrackpointDevice.cpp | ||
* VoodooTrackpoint | ||
* | ||
* Copyright (c) 2019 Leonard Kleinhans <leo-labs> | ||
* | ||
*/ | ||
|
||
#include "TrackpointDevice.hpp" | ||
|
||
OSDefineMetaClassAndStructors(TrackpointDevice, IOHIPointing); | ||
|
||
UInt32 TrackpointDevice::deviceType() { | ||
return NX_EVS_DEVICE_TYPE_MOUSE; | ||
} | ||
|
||
UInt32 TrackpointDevice::interfaceID() { | ||
return NX_EVS_DEVICE_INTERFACE_BUS_ACE; | ||
} | ||
|
||
IOItemCount TrackpointDevice::buttonCount() { | ||
return 3; | ||
}; | ||
|
||
IOFixed TrackpointDevice::resolution() { | ||
return (150) << 16; | ||
}; | ||
|
||
bool TrackpointDevice::start(IOService* provider) { | ||
if (!super::start(provider)) { | ||
return false; | ||
} | ||
|
||
setProperty(kIOHIDScrollAccelerationTypeKey, kIOHIDTrackpadScrollAccelerationKey); | ||
setProperty(kIOHIDScrollResolutionKey, 800 << 16, 32); | ||
setProperty("HIDScrollResolutionX", 800 << 16, 32); | ||
setProperty("HIDScrollResolutionY", 800 << 16, 32); | ||
|
||
registerService(); | ||
return true; | ||
} | ||
|
||
void TrackpointDevice::stop(IOService* provider) { | ||
super::stop(provider); | ||
} | ||
|
||
|
||
void TrackpointDevice::updateRelativePointer(int dx, int dy, int buttons, uint64_t timestamp) { | ||
dispatchRelativePointerEvent(dx, dy, buttons, timestamp); | ||
}; | ||
|
||
void TrackpointDevice::updateScrollwheel(short deltaAxis1, short deltaAxis2, short deltaAxis3, uint64_t timestamp) { | ||
dispatchScrollWheelEvent(deltaAxis1, deltaAxis2, deltaAxis3, timestamp); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/* | ||
* TrackpointDevice.hpp | ||
* VoodooTrackpoint | ||
* | ||
* Copyright (c) 2019 Leonard Kleinhans <leo-labs> | ||
* | ||
*/ | ||
|
||
#ifndef TrackpointDevice_hpp | ||
#define TrackpointDevice_hpp | ||
|
||
#include <IOKit/hidsystem/IOHIPointing.h> | ||
#include <IOKit/hidsystem/IOHIDParameter.h> | ||
|
||
class TrackpointDevice : public IOHIPointing { | ||
typedef IOHIPointing super; | ||
OSDeclareDefaultStructors(TrackpointDevice); | ||
protected: | ||
virtual IOItemCount buttonCount() override; | ||
virtual IOFixed resolution() override; | ||
|
||
|
||
public: | ||
bool start(IOService* provider) override; | ||
void stop(IOService* provider) override; | ||
|
||
virtual UInt32 deviceType() override; | ||
virtual UInt32 interfaceID() override; | ||
|
||
void updateRelativePointer(int dx, int dy, int buttons, uint64_t timestamp); | ||
void updateScrollwheel(short deltaAxis1, short deltaAxis2, short deltaAxis3, uint64_t timestamp); | ||
|
||
}; | ||
|
||
#endif /* TrackpointDevice_hpp */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
c6f2977
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@usr-sse2 is there any cleanup necessary on the VoodooPS2TrackPad needed regarding trackpoints and Thinkpad physical buttons ?
Also is this meant to fix the acidanthera/bugtracker#890 as i believe it is somewhat related