LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 12-05-2023, 10:32 AM   #1
Flexico
Member
 
Registered: Aug 2015
Distribution: Mint MATE
Posts: 153

Rep: Reputation: Disabled
How to stop a key from repeating?


I have my keyboard's calculator key bound to open a Python prompt; it works great except if the key is held down, I get spammed by 100+ python windows and twice I had to do a hard reboot to clear them out.
Is there a way to change my script or a setting somewhere to stop the key repeating?

Laptop: Dell Vostro 5590
OS: Linux Mint 21.2 64-bit

Python start command:
Code:
export PYTHONSTARTUP="/home/flexico/Math/Python/python-start.py"
mate-terminal --working-directory="/home/flexico/Math/Python/Scripts" --title="Python 3" --geometry=70x32 --command python3
 
Old 12-05-2023, 11:36 AM   #2
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,271

Rep: Reputation: 5341Reputation: 5341Reputation: 5341Reputation: 5341Reputation: 5341Reputation: 5341Reputation: 5341Reputation: 5341Reputation: 5341Reputation: 5341Reputation: 5341
I have not tried this myself:

https://help.ubuntu.com/stable/ubunt...t-keys.html.en
 
Old 12-05-2023, 11:40 AM   #3
jayjwa
Member
 
Registered: Jul 2003
Location: NY
Distribution: Slackware, Termux
Posts: 806

Rep: Reputation: 258Reputation: 258Reputation: 258
I don't know from in-script, but 'xset r off' will disable a key repeating on holding it down. 'xset r on' puts it back.
 
Old 12-05-2023, 12:26 PM   #4
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 22,127

Rep: Reputation: 7373Reputation: 7373Reputation: 7373Reputation: 7373Reputation: 7373Reputation: 7373Reputation: 7373Reputation: 7373Reputation: 7373Reputation: 7373Reputation: 7373
The usual way is to set a flag (lock file) in that script and skip execution if it is already set.
 
Old 12-05-2023, 12:50 PM   #5
boughtonp
Senior Member
 
Registered: Feb 2007
Location: UK
Distribution: Debian
Posts: 3,650

Rep: Reputation: 2565Reputation: 2565Reputation: 2565Reputation: 2565Reputation: 2565Reputation: 2565Reputation: 2565Reputation: 2565Reputation: 2565Reputation: 2565Reputation: 2565
Quote:
Originally Posted by Flexico View Post
I have my keyboard's calculator key bound to open a Python prompt; it works great except if the key is held down,
Change the binding to be on key up/release, instead of on key press.

That's in addition to fixing the keyboard repeat rate - if that's not controlled as per Dugan's link, maybe it's in the Keyboard settings under the Mate Control Center?

 
  


Reply

Tags
python, script



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] key ^[[26 repeating over and over after security updates? back40 Debian 4 11-11-2011 09:10 AM
Newly compiled 2.6/ Key repeating? merlinn31 Slackware 3 03-19-2004 04:15 PM
Repeating key actions when keys are held down? carlos123 Linux - Newbie 0 01-29-2003 06:36 AM
Repeating key strokes toxic53 Linux - General 1 12-11-2002 09:06 PM
Weird key repeating problem zovres Linux - Newbie 5 10-14-2002 08:13 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 11:36 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration