Skip to content

Commit 2292380

Browse files
author
Jean-Christophe Vermandé
committed
Minor updates
- Add double-click detection to scroll up/down more faster - Minor project updates
1 parent ca64f19 commit 2292380

File tree

4 files changed

+96
-2
lines changed

4 files changed

+96
-2
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
Changelog
22
=========
33

4+
##### 0.2.1
5+
- Double-click detection for cursor up/down controls to scroll more faster
6+
47
##### 0.2.0
58
- First public release
69
- All remote commands are supported, capabilities: Power, Volume, Special (Menu, Back), Channel Zapper, Color Buttons, Controlpad, Numpad

INSTALL.md

Lines changed: 64 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,64 @@
1-
# Platform-specific
1+
# Raspberry Pi 2 / Pi 3
2+
3+
Update the Pi and install Node.js (LTS) from the NodeSource APT repository.
4+
5+
```
6+
apt-get update
7+
apt-get upgrade
8+
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
9+
apt-get install nodejs
10+
```
11+
12+
Check NodeJs version
13+
14+
```
15+
node -v
16+
```
17+
18+
Install NEEO SDK
19+
20+
```
21+
npm install git+https://github.com/NEEOInc/neeo-sdk.git
22+
```
23+
24+
Install the latest PM2 stable version via NPM
25+
26+
```
27+
npm install pm2@latest -g
28+
```
29+
30+
Generate an active startup script (restarting process manager on server boot/reboot)
31+
32+
```
33+
pm2 startup
34+
```
35+
36+
Install the driver (logged as root)
37+
38+
```
39+
cd /home
40+
mkdir neeo-drivers
41+
cd neeo-drivers
42+
npm install neeo-freeplayer-adapter
43+
```
44+
45+
Edit and update settings file (create if not exists)
46+
47+
```
48+
cd /home/neeo-drivers/node_modules/neeo-freeplayer-adapter
49+
nano settings.json
50+
```
51+
52+
Start the driver with npm or with PM2 according your needs
53+
54+
NPM
55+
```
56+
npm server:freeplayer
57+
```
58+
59+
or
60+
61+
NPM
62+
```
63+
pm2 start lib/main.js
64+
```

lib/controller.js

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ const settings = require('./settings')();
66

77
let lastVolumeUpCmd = Date.now();
88
let lastVolumeDnCmd = Date.now();
9+
let lastCursorUpCmd = Date.now();
10+
let lastCursorDownCmd = Date.now();
11+
12+
913
let playersList = [];
1014

1115
const httpRequest = function(url, callbackSuccess, callbackError)
@@ -96,10 +100,12 @@ module.exports.onButtonPressed = function (name, deviceId) {
96100
powerOn(deviceId);
97101
return;
98102
}
103+
99104
if (name === 'POWER OFF') {
100105
powerOff(deviceId);
101106
return;
102107
}
108+
103109
if (name === 'VOLUME UP') {
104110
if (Date.now() <= (lastVolumeUpCmd + 200)) {
105111
console.log('increase level rapidly');
@@ -109,6 +115,7 @@ module.exports.onButtonPressed = function (name, deviceId) {
109115
}
110116
lastVolumeUpCmd = Date.now();
111117
}
118+
112119
if (name === 'VOLUME DOWN') {
113120
if (Date.now() <= (lastVolumeDnCmd + 200)) {
114121
console.log('decrease level rapidly');
@@ -118,6 +125,27 @@ module.exports.onButtonPressed = function (name, deviceId) {
118125
}
119126
lastVolumeDnCmd = Date.now();
120127
}
128+
129+
if (name === 'CURSOR UP') {
130+
if (Date.now() <= (lastCursorUpCmd + 200)) {
131+
console.log('increase up rapidly');
132+
sendKey(deviceId, keys['CURSOR UP']);
133+
repeat(deviceId, keys['CURSOR UP']);
134+
return;
135+
}
136+
lastCursorUpCmd = Date.now();
137+
}
138+
139+
if (name === 'CURSOR DOWN') {
140+
if (Date.now() <= (lastCursorDownCmd + 200)) {
141+
console.log('decrease down rapidly');
142+
sendKey(deviceId, keys['CURSOR DOWN']);
143+
repeat(deviceId, keys['CURSOR DOWN']);
144+
return;
145+
}
146+
lastCursorDownCmd = Date.now();
147+
}
148+
121149
sendKey(deviceId, keys[name]);
122150
}
123151
};

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "neeo-freeplayer-adapter",
3-
"version": "0.2.0",
3+
"version": "0.2.1",
44
"description": "NEEO driver for Frebbox Player V6 - Free SAS (French ISP)",
55
"repository": {
66
"url": "https://github.com/krikroff77/Neeo-Freeplayer-Adapter"

0 commit comments

Comments
 (0)