Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

button for left/right/down/up/select #22

Open
TWART016 opened this issue Nov 22, 2018 · 5 comments
Open

button for left/right/down/up/select #22

TWART016 opened this issue Nov 22, 2018 · 5 comments

Comments

@TWART016
Copy link

No description provided.

@TWART016 TWART016 changed the title Is it possible to clickt the button for left/right/down/up/select. button for left/right/down/up/select Nov 22, 2018
@TWART016
Copy link
Author

Is it possible to clickt the button for left/right/down/up/select.
How can I search for commands?

@MaxvandeLaar
Copy link

Hi @TWART016,

I am probably a bit late to the game but for anyone else who is in the same pickle. Sending buttons isn't that difficult, however, still took me some time to find enough information about this.

So here is short example:

lgtv.getSocket('ssap://com.webos.service.networkinput/getPointerInputSocket',
    function (err, sock) {
        if (!err) {
            sock.send('button', {name: 'LEFT'}); // ok = ENTER
        }
    });

I have not yet found a list with all possible buttons but it's pretty straight forward, I did found more buttons here https://github.com/supersaiyanmode/PyWebOSTV/blob/master/pywebostv/controls.py

@Mastercrrown
Copy link

Mastercrrown commented Feb 4, 2020

@MaxvandeLaar
i got Problems with this my send.js Looks like:

var lgtv = require('lgtv2')({
url: 'ws://192.168.99.25:3000', clientKey: 'xxxxxxxxxxxxxxxxxxxxxxxx', timeout: '5000'
});

lgtv.on('error', function (err) {
console.log(err);
});

lgtv.on('connect', function() {
lgtv.getSocket('ssap://com.webos.service.networkinput/getPointerInputSocket',
function(err, sock) {
if (!err) {
sock.send('button', {name: 'HOME'});
}
}
);
lgtv.disconnect();
});

but Always i got this error.

-----> node send.js

fs.js:636
binding.open(pathModule._makeLong(path),
^

TypeError: path must be a string or Buffer
at Object.fs.open (fs.js:636:11)

What is the Problem?

can you Help me ?

@Dan83
Copy link

Dan83 commented Feb 5, 2020

@Mastercrrown try this code

 var lgtv = require('lgtv2')({
	url: 'ws://192.168.99.25:3000', timeout: '5000'
});

lgtv.on('error', function (err) {
	console.log(err);
});

lgtv.on('connect', function() {
	
	lgtv.getSocket(
    		'ssap://com.webos.service.networkinput/getPointerInputSocket',
		function(err, sock) {
        	if (!err) {
				sock.send('button', {name: 'HOME'});
        	}
			lgtv.disconnect();
    	}
	);

	//lgtv.disconnect();
});

@Mastercrrown
Copy link

@Dan83
Thank you very much, you made my day!!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants