42SK / TVKILL

An application that lets you turn-off TVs with the IR-blaster of your Android device. Inspired by the TV-B-Gone remote.
GNU General Public License v3.0
106 stars 18 forks source link

long press using repeater or else #17

Open MichaelIndra opened 7 years ago

MichaelIndra commented 7 years ago

I want to ask you. previously, if you use google API to transmit? then you have to use the repeater as well as a TV remote control where you hold the volume up, it automatically increases the volume of your TV hardware. if ever, can you give me an example?

thanks in advance. I apologize if my speech and inappropriate language

nm17 commented 7 years ago

@MichaelIndra, Like that?

@Override
    public boolean onKeyDown(int keyCode, KeyEvent event) {
        if ((keyCode == KeyEvent.KEYCODE_VOLUME_DOWN)){
            // Do something
        }
        return true;
    }

EDIT:

it automatically increases the volume of your TV hardware

You should see issuse #1 before saying that.

MichaelIndra commented 7 years ago

Thank you for the advice. it's to adjust the volume on the gadget? I want to send the signal volume menggunaka ir blaster. but I wanted to send a signal repeater. whether using google API could send the signal repeater? thank you

nm17 commented 7 years ago

@MichaelIndra, My example shows how to do something when volume down is pressed. Also, what does menggunaka ir blaster mean? Can you be more specific?

MichaelIndra commented 7 years ago

ConsumerIrManager mCIR = (ConsumerIrManager) this.getSystemService(Context.CONSUMER_IR_SERVICE); int [] pattern = {9000, 4500, 562, 562, 562, 562, 562, 562, 562, 562, 562, 562, 562, 562, 562, 562, 562, 1687, 562, 1687, 562, 1687, 562, 1687, 562, 1687, 562, 1687, 562, 1687, 562, 1687, 562,562, 562, 562, 562, 562, 562, 1687, 562, 1687, 562, 1687, 562, 562, 562, 1687, 562, 562, 562, 1687, 562, 1687, 562, 562, 562, 562, 562, 562, 1687, 562, 562, 562, 562, 1687, 562, 40500}; mCIR.transmit(38000, pattern);

this is my code for volume up. in real remote, when we press button volume in long time, volume will increase/decrease so fast. I learn the code for long press in real. there are use signal repeater. its possible android using signal repeater for ir blaster? i have try using long key press and thread for increase/decrease.. thank you. and i am sorry for my bad language

nm17 commented 7 years ago

See this wiki.

EDIT:

Also what's the brand of the TV?