Welcome to iraf.net Friday, May 10 2024 @ 03:23 PM GMT


 Forum Index > Help Desk > General IRAF New Topic Post Reply
 Ximtool and the numlock key
   
jturner
 05/02/2007 07:52PM (Read 5427 times)  
+++++
Active Member

Status: offline


Registered: 12/29/2005
Posts: 165
Hi Mike et al.,I'm wondering whether there is a way to alter the behaviour of ximtool so that the menus and contrast don't stop responding when numlock is enabled? Perhaps by editing some X resources in lib/X11/app-defaults, for example? The problem is that inexperienced users get themselves in a tangle at the telescope with this... I did have a quick look through the forums for an answer, but it's hard to do a thorough search of so many posts, so sorry if you have answered this before.Also, whilst I'm asking about ximtool, I'm curious whether there is ever likely to be a 24-bit version? I'm guessing NOAO won't give you time to work on it, but it would be very nice IMO :-).Many thanks,James.

 
Profile Email
 Quote
fitz
 05/02/2007 07:52PM  
AAAAA
Admin

Status: offline


Registered: 09/30/2005
Posts: 4040
Hi James.[quote:b6b4240de9]
I'm wondering whether there is a way to alter the behaviour of ximtool so that the menus and contrast don't stop responding when numlock is enabled? Perhaps by editing some X resources in lib/X11/app-defaults, for example? The problem is that inexperienced users get themselves in a tangle at the telescope with this... I did have a quick look through the forums for an answer, but it's hard to do a thorough search of so many posts, so sorry if you have answered this before.[/quote:b6b4240de9]I can't actually find a keyboard at the moment that reproduces the problem, but essentially what's happening is that the NumLock see is being seen as a modifier for the event. In the simplest case you can disable it entirely using the xmodmap command to clear it, e.g. a command like "xmodmap -pm" will print the current modifier table and you will probably see 'Num_Lock' as 'mod2'. To clear it, then just use[code:1:b6b4240de9] xmodmap -e "clear mod2" # clear the NumLock
xmodmap -e "add mod2 = Num_Lock" # restore it[/code:1:b6b4240de9]The trickier bit is to allow NumLock to exist but not have it interfere with the ximtool behavior. To do this you would need to modify the translation table for XImtool where the actions but <Btn3Down> and <Btn3Motion> are defined to take into account the modifier. I was gonna post that but can't without being able to reproduce it first (recent X systems appear to behave differently wrt NumLock). Anyway, the command "ximtool -defgui" will dump the Tcl gui file you can save an edit (look for the 'imagewin.translation' table), then use "ximtool -gui new.gui" to run it. The first change I'd try is adding something like[code:1:b6b4240de9]! @Num_Lock<Btn3Down>: call(windowColormap,$x,$y) \n\
! @Num_Lock<Btn3Motion>: call(windowColormap,$x,$y) \n\
[/code:1:b6b4240de9]See your favorite X book for modifiers and translation tables and please post what you did if you change it and get it working. [quote:b6b4240de9]
Also, whilst I'm asking about ximtool, I'm curious whether there is ever likely to be a 24-bit version? I'm guessing NOAO won't give you time to work on it, but it would be very nice IMO [/quote:b6b4240de9]I'm sure you're not the only one. There may well be some work on ximtool over the summer, we'll see what happen 8-)Cheers,
-Mike

 
Profile Email
 Quote
jturner
 05/02/2007 07:52PM  
+++++
Active Member

Status: offline


Registered: 12/29/2005
Posts: 165
Hi Mike,Thanks for the detailed suggestions, which are very helpful in understanding what to try. I'll see if I can figure out the rest when I'm observing next week. In the longer term, it sounds like the problem might go away when the observer's workstation is running Linux (even if we can still use ximtool).[quote:f1c0fb5710]See your favorite X book for modifiers and translation tables and please post what you did if you change it and get it working.[/quote:f1c0fb5710]
Will do.James.

 
Profile Email
 Quote
jturner
 05/02/2007 07:52PM  
+++++
Active Member

Status: offline


Registered: 12/29/2005
Posts: 165
Hi Mike,Your suggestion for modifying the ximtool GUI key translations works well as written in your post, thanks :-). I don't really understand why the @ is needed without having a book on X up here, but it does the job nicely anyway.Although this solves the main problem of adjusting the contrast with the right mouse button, menu selections still don't work when num lock is on (clicking on a menu such as "File" brings up the menu list but one cannot then select things from it). I suppose I would need to add a mapping for @Num_Lock<Btn1Down> (or maybe motion) to fix this, but I don't see an appropriate translation table to put it in. There are several tables such as "imagewin", but nothing that seems to apply to the menus.Maybe I can add something like "panelMenu.translations" and put @Num_Lock<Btn1Down> under that? Do you know what the correct object name would be (if there is one) and what call it should translate to? Or maybe each menu item needs its own translation, since there probably isn't a single call that is applicable (sorry if I'm not making sense).Thanks!James.

 
Profile Email
 Quote
fitz
 05/02/2007 07:52PM  
AAAAA
Admin

Status: offline


Registered: 09/30/2005
Posts: 4040
Hi James,Glad the @ trick worked for you. The selection from the menus is a different issue: It may be possible to tweak the translation for the SimpleMenu widget via something like[code:1:45d46e9ef0]
*SimpleMenu*translations: .....
[/code:1:45d46e9ef0]but the translations don't do much more that hightlight and select. The selection is actually implemented in the X11IRAF object manager code where it is triggered from an event mask for ButtonPress/ButtonRelease. The NumLock key modifies the event mask so it may need to be fixed at this level in the code (requiring a recompile/relink) to fix.As I say, I can't reproduce it now. The handling of NumLock is done at the server level in some cases and so this can be tricky to generalize. It may be best to simply disable the NumLock per my earlier mail, I'll look into fixing this in the OBM code as well.Cheers,
-Mike

 
Profile Email
 Quote
fitz
 05/02/2007 07:52PM  
AAAAA
Admin

Status: offline


Registered: 09/30/2005
Posts: 4040
Hi James,Glad the @ trick worked for you. The selection from the menus is a different issue: It may be possible to tweak the translation for the SimpleMenu widget via something like[code:1:548b0234d4]
*SimpleMenu*translations: .....
[/code:1:548b0234d4]but the translations don't do much more that hightlight and select. The selection is actually implemented in the X11IRAF object manager code where it is triggered from an event mask for ButtonPress/ButtonRelease. The NumLock key modifies the event mask so it may need to be fixed at this level in the code (requiring a recompile/relink) to fix.As I say, I can't reproduce it now. The handling of NumLock is done at the server level in some cases and so this can be tricky to generalize. It may be best to simply disable the NumLock per my earlier mail, I'll look into fixing this in the OBM code as well.Cheers,
-Mike

 
Profile Email
 Quote
   
Content generated in: 0.29 seconds
New Topic Post Reply

Normal Topic Normal Topic
Sticky Topic Sticky Topic
Locked Topic Locked Topic
New Post New Post
Sticky Topic W/ New Post Sticky Topic W/ New Post
Locked Topic W/ New Post Locked Topic W/ New Post
View Anonymous Posts 
Anonymous users can post 
Filtered HTML Allowed 
Censored Content 
dog allergies remedies cialis 20 mg chilblain remedies


Privacy Policy
Terms of Use

User Functions

Login