COCKOS
CONFEDERATED FORUMS
Cockos : REAPER : NINJAM : Forums
Forum Home : Register : FAQ : Members List : Search :

Go Back   Cockos Incorporated Forums > Other Software Discussion > WDL users forum

Reply
 
Thread Tools Display Modes
Old 02-10-2017, 05:35 PM   #1
earlevel
Human being with feelings
 
Join Date: Dec 2015
Posts: 331
Default Handling arrow keys in a text control

Question: Is there a way to handle special keys while editing a field (ITextControl)?

The answer appear to be "No", at least for OS X.

I want to handle up/down arrow keys to increment and decrement the field's value. The user can type a value (milliseconds), and bump the value in 10 ms increments with the up/down arrows.

The immediate solution for OS X appears to be implementing doCommandBySelector. (I don't know Cocoa at all, so there remains the hurdle of figuring out exactly how to work that in. Edit: OK, that was really easy.)

I haven't looked at the Windows side. It seems that the text fields should be handled in a more generic way instead of handing off to a platform-specific control, but I'm not going to head down that path at this point of trying to ship a product.

Comments? Ideas? Thanks...

Edit: Maybe I should have stated that differently. I'm not stuck, just don't want to recreate something that might have already been done in a branch, or if I'm going to submit a change, want to do it in a way that will be most helpful.

Last edited by earlevel; 02-10-2017 at 08:14 PM.
earlevel is offline   Reply With Quote
Old 02-11-2017, 02:23 PM   #2
earlevel
Human being with feelings
 
Join Date: Dec 2015
Posts: 331
Default

Well, the bottom line is that the edit fields should not be using native OS objects for PromptUserInput. The entry fields should be done in C++ so the programmer can override behavior as needed. There's no good way to do much beyond default behavior otherwise.
earlevel is offline   Reply With Quote
Old 02-11-2017, 05:20 PM   #3
olilarkin
Human being with feelings
 
Join Date: Apr 2009
Location: Berlin, Germany
Posts: 1,248
Default

always wanted to do that but it proved to be quite hard
__________________
VirtualCZ | Endless Series | iPlug2 | Linkedin | Facebook
olilarkin is offline   Reply With Quote
Old 02-11-2017, 08:29 PM   #4
earlevel
Human being with feelings
 
Join Date: Dec 2015
Posts: 331
Default

Quote:
Originally Posted by olilarkin View Post
always wanted to do that but it proved to be quite hard
Definitely not something I'm going to try to add near the point of shipping a product
earlevel is offline   Reply With Quote
Reply

Thread Tools
Display Modes

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 On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 08:55 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.