Git Product home page Git Product logo

Comments (3)

Cathwyler avatar Cathwyler commented on May 28, 2024 1

Hi. Thank for your feedback. That's possible and that's a good idea because everyone would have probably some specific use.
That's easy to do but the HMI part will take me a while.
While waiting for a new version if you are able to compile the project with visual studio you can try modify /Resources/TV/MagicRemoteService/main.js

document.addEventListener("keydown", function(inEvent) {
switch(inEvent.keyCode) {
case 0x08:
case 0x0D:
case 0x25:
case 0x26:
case 0x27:
case 0x28:
SendKeyboardKey({
usC: inEvent.keyCode,
bS: true
});
break;
case 0x194:
SendKeyboardKey({
usC: 0x5B,
bS: true
});
break;
case 0x195:
SendMouseKey({
usC: 1,
bS: true
});
break;
case 0x1CD:
SendKeyboardKey({
usC: 0x1B,
bS: true
});
break;
default:
break;
}
});
document.addEventListener("keyup", function(inEvent) {
switch(inEvent.keyCode) {
case 0x08:
case 0x0D:
case 0x25:
case 0x26:
case 0x27:
case 0x28:
SendKeyboardKey({
usC: inEvent.keyCode,
bS: false
});
break;
case 0x193:
if(bInputSourceStatus){
Dialogue(oString.strAppTittle, oString.strShutdownMessage, [
{
sName: oString.strShutdownShutdown,
fAction: function(){
SendShutdown();
}
}, {
sName: oString.strShutdownAbort,
fAction: null
}
]);
} else {
Dialogue(oString.strAppTittle, oString.strStartMessage [
{
sName: oString.strStartStart,
fAction: function(){
SendWol({
tabMac: tabMac
}, sBroadcast);
}
}, {
sName: oString.strStartAbort,
fAction: null
}
]);
}
break;
case 0x194:
SendKeyboardKey({
usC: 0x5B,
bS: false
});
break;
case 0x195:
SendMouseKey({
usC: 1,
bS: false
});
break;
case 0x196:
if (KeyboardVisible() === true) {
document.getElementById("keyboard").blur();
} else {
document.getElementById("keyboard").focus();
}
break;
case 0x1CD:
SendKeyboardKey({
usC: 0x1B,
bS: false
});
break;
default:
break;
}
});

Case 0x193 to 0x196 are the color key. refer to https://webostv.developer.lge.com/develop/guides/magic-remote.
The Windows vk key you need are probably 0xB0 to 0xB3.
You can remap in main.js each case 0x193 to 0x196 in keydown and keyup event with replacing

case 0x193: //Color key
	...
	break;

with or add

case 0x193: //Color key
	SendKeyboardKey({ 
		usC: 0xB0, //VK Key
		bS: true //true in keydown event false in keyup event
	}); 

I forgot that you will need to add vk key case in

case 0x0D:
case 0x25:
case 0x26:
case 0x27:
case 0x28:
case 0x5B:

After compile you need to run and install it on TV.

from magicremoteservice.

Cathwyler avatar Cathwyler commented on May 28, 2024 1

You can now change Remote keybind from UI.

from magicremoteservice.

paperboyo avatar paperboyo commented on May 28, 2024

Thanks! Customisation UI would indeed be ideal, but even if the mapping woul exist in a simple config file, that would help a lot (unless the compilation step would be still necessary, which may be too hard for some, like me: although I will try!).

Thanks again!

from magicremoteservice.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.