From: Neil M. <ne...@cs...> - 2004-04-24 10:56:54
|
On 24 Apr 2004, at 10:23, Cameron Laird wrote: > I *think* I circulated a muddled question yesterday. > Rather than writing, > I'm working with a code base with abundant > bind $w <Button-3> ... > and so on, and wonder if there's a canoni- > cal want to create this event with a standard > Macintosh one-button mouse, > I had some nonsense about <Double>. Anyway, my > question stands. I know I've seen discussions of > this before. Some toolkits map, for example, > control-click to Button-3. I haven't yet figured > out, though, how Tk handles this. Cameron - not sure if TkAqua does this for you (doesn't look like it), but I think control-click is roughly equivalent to right-click from my experience. You could do something like: bind . <Control-Button-1> [list event generate . <Button-3>] You might need to be a bit more clever to make sure that %x %y etc stuff is correct in the new event. This makes me wonder though; would it be a good rule of thumb to always bind to virtual events? That would probably make this sort of thing much easier: event add <<RightClick>> <Button-3> <Control-Button-1> bind . <<RightClick>> { ... } A related question: I have a 3-button mouse which I use with os x. However, the right mouse button gets delivered as <Button-2> and the middle as <Button-3>, which is different to how most apps bind to right and middle mouse button normally. I've been told that this is just a misconfiguration of my mouse somewhere, but I'm not so sure - the right mouse button acts correctly in every application other than Tk-based ones. Anyone have any clues? If it is a misconfiguration - anyone know where to correct it? Cheers, Neil. |