AFNI Message Board

Dear AFNI users-

We are very pleased to announce that the new AFNI Message Board framework is up! Please join us at:

https://discuss.afni.nimh.nih.gov

Existing user accounts have been migrated, so returning users can login by requesting a password reset. New users can create accounts, as well, through a standard account creation process. Please note that these setup emails might initially go to spam folders (esp. for NIH users!), so please check those locations in the beginning.

The current Message Board discussion threads have been migrated to the new framework. The current Message Board will remain visible, but read-only, for a little while.

Sincerely, AFNI HQ

History of AFNI updates  

|
February 14, 2014 12:33PM
OK, after working a little with Rick on his Linux system, the issue comes down to the way that AFNI detects if the 'Alt' (Linux) or 'Command' (Mac) key is pressed down while the scroll wheel is scrolling. This detection is done by examining the 'modifier state mask' during the scroll 'event'. The mask is usually set to Mod1 for the Alt key on Linux and to Mod2 for the Command key on Mac. So to be safe, I check if EITHER of these is pressed -- if so, then scrolling changes the Define Overlay threshold rather than changing the slice slider.

However, on some Linux systems, it seems like the Mod2 mask is always on when the scroll wheel is used. As a result, scroll wheeling in an image always implies threshold slider change, not slice slider change moody smiley

So my solution is to let the user (e.g., YOU) control which key press switches the scroll wheel from slice changing to threshold changing. I hope the above explanation is clear, since you need to understand in order to change things.

To make it so that only the Mod1 (=Alt key) mask does the switcheroo from slicing to thresholding, set environment variable AFNI_IMAGE_SCROLLWHEEL_TMASK to the value 'Mod1' (this is not case sensitive). You can do this, as usual, in your ~/.afnirc file or in various other places.

The full documentation for what you can do with this variable is below. This change is now in the source code, and (if I remember) the binaries will be re-built tonight.

--------------------------------------
Variable: AFNI_IMAGE_SCROLLWHEEL_TMASK
--------------------------------------
This variable lets you control which keyboard modifier keys are
checked when the mouse scroll wheel is used inside the image.
If one (or more) of the selected keys is pressed while the
scroll wheel is moved, then the AFNI controller 'Define Overlay'
threshold slider moves -- otherwise (the normal case), the image
slice slider moves.

The value of this variable should be contain
one or more of these strings (NOT case sensitive):
  • Shift = Shift key pressed
  • Ctrl or Control = Control key pressed
  • Mod1 = Alt key pressed (Linux)
  • Mod2 = Command key pressed (Mac OS X)
If you do NOT set this variable, it is like setting it to the
value 'Mod1+Mod2' (so that Alt and Command work on Linux and
Mac OS X, respectively).

However, some Linux systems seem to
always have the Mod2 mask set for the scroll wheel, and so
the wheel ALWAYS change the threshold slider and not the slice.
To prevent this sad thing from happening, set this variable to
just 'Mod1'.

Furthermore, if you include the string 'Debug'
in this variable, when the scroll wheel is used over the image
sub-window, some information will be printed out about what the
program detects, which might help you set things up correctly.

On my Mac, I get the following 'Debug' output when using the scroll wheel
twice -- first with no key pressed and then with the Command key:
++ Scrollwheel (imag): button=5 ; state mask=0x
.+ (mask: shift=1x ctrl=4x mod1=8x mod2=10x mod3=20x mod4=40x mod5=80x)
.+ change slice
++ Scrollwheel (imag): button=5 ; state mask=10x
.+ (mask: shift=1x ctrl=4x mod1=8x mod2=10x mod3=20x mod4=40x mod5=80x)
.+ change threshold
The second use shows that the 'state mask' (which shows the modifier
keys) was hexadecimal '10x', which corresponds to the 'mod2' value.
Subject Author Posted

Linux scroll wheel behavior

celstark February 12, 2014 03:32PM

Re: Linux scroll wheel behavior

rick reynolds February 12, 2014 03:41PM

Re: Linux scroll wheel behavior

Emperor Zhark February 12, 2014 04:23PM

Re: Linux scroll wheel behavior

rick reynolds February 12, 2014 04:38PM

Re: Linux scroll wheel behavior

celstark February 13, 2014 08:45PM

Re: Linux scroll wheel behavior

rick reynolds February 14, 2014 08:54AM

Re: Linux scroll wheel behavior

Emperor Zhark February 14, 2014 09:38AM

Re: Linux scroll wheel behavior

Emperor Zhark February 14, 2014 12:33PM

Re: Linux scroll wheel behavior

celstark February 14, 2014 03:13PM