discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: keyboard selection


From: Fred Kiefer
Subject: Re: keyboard selection
Date: Mon, 20 Aug 2007 15:26:54 +0200
User-agent: Thunderbird 1.5.0.12 (X11/20060911)

Riccardo wrote:
> Hello,
> 
> inside textfields (GNUMail message editing and Ink are an example) I
> think I used to be able to select text using shift + arrows movment. I
> notice today that it is not possible. Is it a bug? Or am I just used to
> do it on other platforms?
> 

Thank you for spotting this. The reason for this was really hard to
track down. It turns out to be the following line in NSInputManager:

BOOL isFunctionKey = [theEvent modifierFlags] & NSFunctionKeyMask;

This used to work while the value for NSFunctionKeyMask was in the first
byte, but now it is 1<<24 and the resulting BOOL was NO.
This should be a warning to all of us to program more careful and always
use explicit comparisons for integer masks. This code does the trick:

BOOL isFunctionKey = ([theEvent modifierFlags] & NSFunctionKeyMask)
        == NSFunctionKeyMask;


Cheers,
Fred




reply via email to

[Prev in Thread] Current Thread [Next in Thread]