Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6208435
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T05:48:31+00:00 2026-05-24T05:48:31+00:00

I’m using LIRCd to capture the keys I press on my remote control, with

  • 0

I’m using LIRCd to capture the keys I press on my remote control, with the proper configuration file.
According to the documentation, I have to wait for the blocking function lirc_nextcode() to return and I get a nice line to decode, like this:

0000000080bf4bb4 00 CURSOR_DOWN myremote

First number is the key value, next is the amount of repeats that this key was pressed (here 0, since I only pressed it and released it), then the key name and my remote’s name.

Anyway, what I’d like to do is detect the key up of my remote.

If I press a button for a certain amount of time, this is what I get (new line every ~ 200ms):

0000000080bf4bb4 00 CURSOR_DOWN myremote
0000000080bf4bb4 01 CURSOR_DOWN myremote
0000000080bf4bb4 02 CURSOR_DOWN myremote
0000000080bf4bb4 03 CURSOR_DOWN myremote
0000000080bf4bb4 04 CURSOR_DOWN myremote
0000000080bf4bb4 05 CURSOR_DOWN myremote
0000000080bf4bb4 06 CURSOR_DOWN myremote
0000000080bf4bb4 07 CURSOR_DOWN myremote
0000000080bf4bb4 08 CURSOR_DOWN myremote
0000000080bf4bb4 09 CURSOR_DOWN myremote
0000000080bf4bb4 0a CURSOR_DOWN myremote
// I let go for 1s and press it again:
0000000080bf4bb4 00 CURSOR_DOWN myremote

So the second number increments whenever I long-press a key, but once I release it and press it again, it resets to 0.

What I want is be able to detect the moment when the repeat stops.

Now, I can see how I could implement a key up detection: if lirc_nextcode() doesn’t crack after a certain amount of time, I can consider that the key has been released.

What I’m asking you is: is there another (more proper) way to do that?
By configuring LIRCd maybe?

Or, if there’s no other way to do it than with a timer, what’s the best implementation?
Indeed, the lirc_getcode() is blocking, so whenever a timer cracks, I need it to return!

edit: btw, no lirc or lircd tag, would be nice to have!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T05:48:32+00:00Added an answer on May 24, 2026 at 5:48 am

    I’ll do it by storing last code received and compare with new one, if codes are different then stored key was released. For what I see in your post, seems that code length is fixed, so you should’nt have much problems implementing it as I’ve said, just ignore last byte (repeat count).

    IR transmitters works by repeating same code while holding key, so you’ll need to know “guard time”, that is delay between repeats. You sould test for this delay to see if no repeats are comming, if nothing comes after that delay, you could assume that user released key (KEY UP).

    In short:

    1. Read a code
    2. Store it in a var to compare later
    3. Poll port for more codes, if nothing comes and guard time expired then KEY UP=true
    4. Got a code, compare with stored one, if equal go looping label 3
    5. If different then KEY UP=true, go more looping to label 2
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have just tried to save a simple *.rtf file with some websites and
We are using XSLT to translate a RIXML file to XML. Our RIXML contains
I have thousands of HTML files to process using Groovy/Java and I need to
I have a reasonable size flat file database of text documents mostly saved in
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
That's pretty much it. I'm using Nokogiri to scrape a web page what has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a jquery bug and I've been looking for hours now, I can't
this is what i have right now Drawing an RSS feed into the php,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.