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

[sc-users] Integer modifier keys



Does anyone recognize this code at the bottom of Integer.sc ?

// support for modifiers keys
isCaps { ^this.bitAnd(65536) == 65536}
isShift { ^this.bitAnd(131072) == 131072 }
isCtrl { ^this.bitAnd(262144) == 262144 }
isAlt { ^this.bitAnd(524288) == 524288 }
isCmd { ^this.bitAnd(1048576) == 1048576 }
isNumPad { ^this.bitAnd(2097152) == 2097152 }
isHelp { ^this.bitAnd(4194304) == 4194304 }
isFun { ^this.bitAnd(8388608) == 8388608 }


How would someone use these numbers? Do they somehow allow us to write code
that is functionally consistent across all platforms? Without using
something like:

Platform.case
{
	\windows
}{
	// do Windows command
}
{
	\osx
}{
	// do OSX equivalent of Windows command
}

Thanks in advance, I'm just looking for the most basic idea about what these
numbers mean and how to use them.





--
View this message in context: http://new-supercollider-mailing-lists-forums-use-these.2681727.n2.nabble.com/Integer-modifier-keys-tp7629977.html
Sent from the SuperCollider Users New (Use this!!!!) mailing list archive at Nabble.com.

_______________________________________________
sc-users mailing list

info (subscription, etc.): http://www.birmingham.ac.uk/facilities/ea-studios/research/supercollider/mailinglist.aspx
archive: https://listarc.bham.ac.uk/marchives/sc-users/
search: https://listarc.bham.ac.uk/lists/sc-users/search/