Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
dewiweb committed Feb 26, 2024
2 parents ab18ca7 + e16cb20 commit cec10ad
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 10 deletions.
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,19 @@

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

### [2.1.2](https://github.com/dewiweb/spacemouse-osc/compare/v2.1.2-0...v2.1.2) (2024-02-26)

### [2.1.2-0](https://github.com/dewiweb/spacemouse-osc/compare/v2.1.1...v2.1.2-0) (2024-02-26)


### Bug Fixes

* :bug: fix bug with buttons in linux ([be9dff3](https://github.com/dewiweb/spacemouse-osc/commit/be9dff3d137a1a47681257823248f128ad222c3e))

### [2.1.1](https://github.com/dewiweb/spacemouse-osc/compare/v2.1.1-0...v2.1.1) (2024-02-26)

### [2.1.1-0](https://github.com/dewiweb/spacemouse-osc/compare/v2.1.0...v2.1.1-0) (2024-02-26)

## [2.1.0](https://github.com/dewiweb/spacemouse-osc/compare/v2.1.0-0...v2.1.0) (2024-02-26)

## [2.1.0-0](https://github.com/dewiweb/spacemouse-osc/compare/v2.0.0...v2.1.0-0) (2024-02-26)
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"name": "dewiweb",
"email": "[email protected]"
},
"version": "2.1.0",
"version": "2.1.2",
"main": "src/main.js",
"license": "MIT",
"devDependencies": {
Expand All @@ -23,6 +23,7 @@
"electron-context-menu": "^3.6.1",
"electron-log": "^4.4.8",
"electron-preferences": "^2.8.2",
"lodash": "^4.17.21",
"node-hid": "^3.0.0",
"osc": "^2.4.4"
},
Expand Down
2 changes: 1 addition & 1 deletion src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -600,7 +600,7 @@ async function main() {
const { translate, rotate, buttons } = mouse.mice[0];
const { x: translateX, y: translateY, z: translateZ } = translate;
const { x: rotateX, y: rotateY, z: rotateZ } = rotate;

console.log("buttons : ",buttons)
// Sending button data to the main window
win.webContents.send("buttons", buttons);

Expand Down
20 changes: 12 additions & 8 deletions src/renderer.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const { ipcRenderer } = require('electron');
const preferences = ipcRenderer.sendSync('getPreferences');
const log = require('electron-log');

const _ = require('lodash');
const modeFunctions = {
aed: aedMode,
ad: adMode,
Expand Down Expand Up @@ -170,23 +170,27 @@ ipcRenderer.on('incoming_data', (event, translateX, translateY, translateZ, rota
if (visible !== "hidden") {
let now = Date();
var inc_value = table.rows[4].cells[i].firstElementChild.value
//console.log("inc_value", inc_value)
if (inc_value !== 0){
ipcRenderer.send("ok_to_send", prefix, index, index_or_not, attrib, inc_value)
console.log("inc_value", inc_value)
if (inc_value !== "0"){
ipcRenderer.send("ok_to_send", prefix, index, index_or_not, attrib, inc_value)
}
}
}

})

ipcRenderer.on("buttons", (event, buttons) => {
const processButtons = _.debounce((buttons) => {
if (buttons[0] === true) {
document.getElementById("index").stepDown()
document.getElementById("index").stepDown();
}
if (buttons[1] === true) {
document.getElementById("index").stepUp()
document.getElementById("index").stepUp();
}
})
}, 20); // 200 milliseconds debounce rate

ipcRenderer.on("buttons", (event, buttons) => {
processButtons(buttons);
});

function displayForm3(event) {
const add3 = document.getElementById('add3');
Expand Down

0 comments on commit cec10ad

Please sign in to comment.