13 August 2024, 07:06 | #1 |
old chunk of coal
Join Date: Nov 2011
Location: Hungary
Posts: 1,318
|
System friendly way of disabling repeated key events
I have a program that uses IDCMP to process key events. This works great for the most part, but the key repeat functionality generates a lot of extra IDCMP_RAWKEY messages when the key is held. I can filter them out based on the qualifier, but the program still has to process all these messages sent to the window's port.
Is there a way to prevent the repeated key IDCMP messages from being sent to the window? One idea that came to mind is a high priority input handler to preprocess the input event, but then I might as well process the events there. A global way to disable key repeat would also work, as this could be toggled when the window is activated/inactivated. |
13 August 2024, 11:53 | #2 |
Registered User
Join Date: Jun 2016
Location: europe
Posts: 1,097
|
1. Did you try the WA_RptQueue window tag (I think it's KS2.0+)? I haven't messed around with it, but if you set it to 0, would it disable the repeats in your window?
If that doesn't work... 2. Set repeat threshold, via input.device, to a very high value, this would affect everything though. 3. Install a custom handler for input.device with high priority, to handle rawkey events. In your handler you first check if the current window (intuibase->ActiveWindow) is your window. If yes, send a (single) event to your own message port and terminate the chain. If no, do nothing (pass the event down the chain, to input.device's own handler which will then handle the repeats). |
13 August 2024, 16:38 | #3 |
son of 68k
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,391
|
If everything else fails, there is still the possibility to create another, somewhat higher priority task that will get the messages and only forward the ones that are relevant to the main process. This just needs changing the task in the message port (and some way to give key data to the main task).
Of course, at the end everything depends on why these messages are annoying at first place. |
13 August 2024, 16:46 | #4 |
old chunk of coal
Join Date: Nov 2011
Location: Hungary
Posts: 1,318
|
Thanks for all the ideas, I tried WA_RptQueue and it's exactly what I was looking for. If I set it to 0 the window longer receives any repeated IDCMP_RAWKEY messages
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Disabling the HELP key | StompinSteve | support.AmigaOS | 4 | 22 January 2024 20:42 |
REQ: NoiseTracker or ProTracker System friendly source | redblade | Coders. Asm / Hardware | 4 | 27 February 2021 08:56 |
Is there a way to get key events for pageup, pagedown, insert...? | softwarefailure | support.WinUAE | 8 | 10 July 2018 19:44 |
System friendly Protracker Replay? | AGS | Coders. System | 2 | 16 August 2014 20:53 |
Assembler System Friendly code | redblade | Coders. General | 3 | 29 July 2008 12:15 |
|
|