Monday, February 9, 2015

I'm not dead, and neither is xGestures!

Hello to the few people that read this!

Sorry I've been completely neglecting my website and xGestures. I have a lot of other stuff on my plate these days, not the least of which is the paid work I'm doing, so after all is said and done I have almost no free time and energy to continue working on xGestures.

That said, I still use it and rely on it every day, so I won't let it completely waste away. If you're a dedicated user of xGestures, you can take some solace knowing that I can't live without it either, so if it totally breaks, I'll have no choice but to fix it or risk being driven to madness by a world bereft of mouse gestures.

Concerning OS X 10.10 Yosemite: xGestures *does* work in it, if you perform some steps to make it allowed to use OS X's accessibility features, which most of the gesture actions require. Here's how to do it:
  1. Find the xGestures.prefpane file (located in either ~/Library/PreferencePanes or /Library/PreferencePanes)
  2. Right click and pick "Show package contents"
  3. Open Contents / Resources
  4. Next open System Preferences / Security & Privacy
  5. Pick Privacy tab
  6. Select Accessibility
  7. Click lock, enter an admin password
  8. Drag xGestures.app from the Resources folder onto the list of applications in the Accessibility section
  9. Make sure the checkbox next to it is checked
  10. If xGestures is already listed in the Accessibility section and it's still not working, try removing xGestures from the list and adding it again.
I've also started working on a new version that fixes this bug, but half of the users I sent it to said it doesn't fix it, so I still have more work to do. Hopefully at some point soon I'll actually be able to release it.

Sunday, June 27, 2010

New xGestures news, plus getting xGestures to work with Chrome

Okay, time to update this blog!  It's been over a year, which is pretty ridiculous.

First, since I'm sure some people are wondering about this, I am still developing xGestures, though I haven't had time to put really any substantial work into it for the last couple of years of my life.  However, I have recently cut back my hours at my job, and with the extra time one of the things I plan to do is make a new 2.0 release of xGestures with tons of new features.  I won't say when it'll be done, because I haven't started working on it just yet and I don't know how long it'll take.  But I want it to have oft requested features such as diagonal gestures, if not complex gestures in general, as well as more gesture actions, more ability to have gestures apply to specific contexts, and things like that.  I'll be sure to update this blog as work progresses on that.  I might also release another minor update to address some long outstanding bugs, but I'm not sure yet.

Second, an issue a lot of people report to me is that xGestures doesn't work with Google Chrome.  I don't know why it took me this long to figure it out, but turning on the "Window under the start of the gesture determines the application" button in the Options section of the preference pane is what breaks things.  So if you use Chrome, you probably want to turn that feature off.  In whichever new release of xGestures I make, I'll be sure to fix that.

While I'm talking about the "Window under the start of the gesture..." feature, I'll also add that even if you don't use Chrome, you might want to turn that feature off.  It doesn't work very well --- results are inconsistent.  Looking back over how xGestures works I can see that I never really implemented that feature properly, especially since lots of gestures don't actually work if the program they're for is in the background.  I'll try to address that better in xGestures 2.0, at least by making it work consistently somehow.

Wednesday, June 17, 2009

Closing the tab that you gestured over

Hey, remember this blog?  I barely do.

I just solved an interesting xGestures problem someone posed to me: how can they get it so that the tab they gesture over is closed, rather than making a gesture type Command-W, thus closing whichever tab is active?  Furthermore, how can they close tabs when Safari is in the background?

To solve it, I wrote an AppleScript that should do exactly that.  Maybe someone else will find it interesting.  The thing to remember about xGestures is that it can have practically any behavior you want by using AppleScript.  The problem is that writing AppleScripts is really only an option for people who are already programmers and have the time and inclination to learn to write them.  So I'll keep posting the interesting ones I write.

Here's the script:

set x to mouse x
set y to mouse y
tell application "Safari"
set targetWindow to {}
set theWindows to the windows
repeat with i from 1 to the count of theWindows
set theBounds to bounds of item i of theWindows
if x ≥ item 1 of theBounds and x ≤ item 3 of theBounds and y ≥ item 2 of theBounds and y ≤ item 4 of theBounds then
if targetWindow ≠ {} then
if index of item i of theWindows <>
set targetWindow to item i of theWindows
end if
else
set targetWindow to item i of theWindows
end if
end if
end repeat
if targetWindow ≠ {} then
close current tab of targetWindow
end if
end tell

This script requires the XTools scripting addition because otherwise there's no way to get the mouse location in an AppleScript.  XTools can be downloaded here: http://osaxen.com/files/xtool1.1.html

Monday, April 21, 2008

HotBox 1.0 is released

Finally, I manage to release a software project I had been working on sporadically for months. It really does take a lot of time for me to finish things I start.  But it's done, and I'm very proud of it!

So far, things have been going well.  I was afraid for a while that I would be assaulted with bug reports of all sorts of things not working in HotBox, but for the most part, people seem to be happy.  I've gotten a few bug reports here and there but they seem to be isolated cases rather than signs of huge, sweeping problems.

Also, I'm very thankful to everyone that's donated to HotBox so far.  There's all sorts of other projects I want to embark on now that it's done, and of course there's going to be further development in it too, and donations definitely keep me encouraged to keep working.  Another thing is if people are donating, that means that they think the program is cool enough that it's worth giving money to the author, and that's awesome.  HotBox was absolutely a project I started because I thought it was a really good idea and that other people would enjoy it a lot, and so far it seems to be that people like it.  Word.

I should address one thing, which is the number one most requested feature in the few days HotBox has been out on the internet, and that is:  Using the cursor while zoomed in.

Here's the quick answer: I really want to add this feature, but I don't know if it's possible, and I don't know when I'll have time to add it.  So don't hold your breath yet.

Here's a longer answer that requires a bit of an explanation of how HotBox actually works:

HotBox doesn't do anything especially magical in terms of getting the screen to zoom in.  It basically makes clever use of the Mac OS X accessibility feature for zooming in that's existed in the OS for some time now.  A few users were quick to point out that you can accomplishing zooming also by using Command-Option-+ and -, or by holding control and using the scroll wheel, and this is true.  The disadvantage, though, was that as soon as your zoomed in that way, moving the mouse around would cause the screen to move with it, and a potentially huge cursor would sit on top of whatever you were trying to watch.  Also, it's difficult to get the thing you want to zoom in on to fit the screen perfectly.  I made HotBox in order to address those problems, as well as a few others.

However, all HotBox is doing is calculating how much the screen needs to zoom in and telling the OS to zoom in that much next time, figuring out exactly where the cursor needs to be on screen in order to make the thing you selected fit properly, moving the cursor to that point and freezing its location, and then simulating a zoom-in hot key press. The result: the screen zooms in on exactly what you selected. (Note the emphasis in the previous paragraph.)

So the problem is, if I kept the mouse unfrozen while HotBox is invoked, the screen will scroll around with it.  Granted it's possible to change things so that the screen only scrolls around once the cursor reaches the edge of what's visible (and in fact HotBox does this), but then it's still a problem when you move the cursor outside of the zoomed in area.  (Some people might have noticed that you can actually still move the cursor around and scroll the screen.  This is in fact a bug, and I will probably fix it fairly soon.)  Basically I'd need to get it so that the cursor is constrained to a specific region of the screen, and there's no good way to do that in Mac OS X that I know of.  My theories on how to pull this off regardless involve some tricks possibly involving a fake cursor, but I won't get into that now.

So rest assured, when I get the chance, I'm going to try to add the mouse functionality to HotBox... but I can't guarantee I'll be able to make it work. HotBox's primary function was to make it possible to watch online videos full screen when they don't have a full screen button. But since it can potentially be really useful for presentations and other things like that, I'll see if I can't make it even better.

Monday, November 26, 2007

Updated xGestures again / USB Overdrive trick

New version of xGestures - 1.73.  It's a bug fix release, so no new awesome features this time.  This version should fix all of the hot corners and Dock related problems Leopard users have been having, as well as several other Leopard bugs.

I still haven't had a chance to fix the Wacom tablet problem, but it's still on my list of things to do, as well as several other things.  I plan to release at least one more version of xGestures in the not too distant future that fixes the rest of the bugs people have been complaining about off and on, as well as adding some Leopard specific features for things like Spaces and Time Machine.

(Incidentally, if you want to have gestures for those now, you can set xGestures to keystroke any of the various Spaces keystrokes.  You will have to temporarily change them to something different before you enter them into the xGestures pref pane, since otherwise they'll just switch the screen space and the pref pane won't register the keystroke.  But just change the Spaces keystrokes back again afterwards and it should work great.)

Also, for users using USB Overdrive:  Someone recently emailed me asking how they could use one of their really auxilery mouse buttons with xGestures and USB Overdrive at the same time.  (In this case it was mouse button #7.)  The problem is, USB Overdrive only allows mouse clicks up to button #5.  But you can work around that by having USB Overdrive do a keystroke for the button you want to use, and then set xGestures to use that keystroke for gesturing.  It works great!

Granted there's probably not a lot of people who'll find that tip useful, since it involves using both USB Overdrive and wanting to use an abnormally high button number to gesture.  But I thought it was especially clever, and it was useful to at least one person out there.

Monday, October 22, 2007

Finally updated xGestures

It's been... over ten months since I released a new version of xGestures?  I want to make it clear that I haven't abadonned the project at all.  In fact, I still use it every day, all the time.  However, I've come to realize that actually programming professionally for 8 hours a day, having a fairly active social life, and being lazy really makes it difficult for me to work on programming projects in my free time.  But I'm trying to get better about it.

So I've finally released a relatively minor update to xGestures that fixes a bunch of bugs that people have been complaining about for a while.  Unfortunately, there are still several bugs that I haven't had the opportunity to fix, and several features people have been requesting forever now that I still haven't had the time to add.  But in case you're wondering, here's stuff I really, honestly, plan to do at some point in the future:
  • Adding a feature for exporting and importing preferences. I plan to make this work so that you can import individual application preferences, as well as duplicate gestures and entire applications. So if you have 5 zillion gestures set up for your favorite web browser, and then you start using a slightly different web browser, you can copy over the gestures rather than having to do them all over again.
  • I want to fix the Wacom tablet problem.  LOTS of people have complained that xGestures doesn't work with Wacom tablets.  The problem, though, is that I don't own a Wacom tablet and don't have easy access to one right now.  As soon as I can get my hands on one, though, I'm going to see if I can fix things.
Now I should probably give some lip service to features that people have requested that are pretty low priority right now.  Which is to say, there are a bunch of other things I want or need to do in  my spare time before I'll have a chance to work on this stuff.  So the big one is diagonal gestures, or other kinds of complex gestures.  I really want to add that to xGestures, but it'll take a lot of work and I just don't have the right now.  Another big one is complex or advanced gesture actions, that can do neat things like do various different things depending on context, or start performing several actions in order until one of them succeeds.  That'd be a great feature to have, but once again it'll take oodles of work.  There's also adding a feature like being able to gesture with more than one mouse button.  So something like right-click gesturing in a direction will do action A, and middle-click gesturing in the same direction will do action B.  Or more rocker gestures, like holding the right button and clicking the middle button or something like that.   However, I want to be careful with these new features, because one of the things I'm trying to be careful about is not making xGestures really complex and annoying to use.  So if I implement any of these features, I'm going to try my hardest to make them simple and intuitive, but still powerful.

I'm also working on a new software project right now that's already getting pretty close to being finished. I'd say it's something like 70% of the way there. I'm almost certainly going to release it as freeware or donationware, because it's simple enough that I don't think it warrants people having to go through the effort of paying money to use it. But it's a cool idea, though, and it might actually be pretty popular. I'm not going to say what it is though just so I can be stupidly secretive with the four people who read this blog!!

Sunday, April 8, 2007

Screenshots in xGestures

Just earlier today someone emailed me asking if there was some way to create gestures in xGestures that would take screen shots, like pressing command-shift-3.  I figured it would be a pretty simple thing, since you can create keystroke actions and just have one of those press command-shift-3.  What I found out is that even if you get passed the first hurdle of figuring out how to enter that keystroke the xGestures preference pane without actually taking a screenshot instead, it still doesn't work.  There's a bug in xGestures I'm going to try to address as soon as I get the chance to make those sorts of keystrokes work, because apparently any kind of system-level key command can't be triggered by xGestures.

Not to be defeated, though, I figured that maybe there was some kind of neat way to do it using AppleScript.  And sure enough, there is.  Hidden in Mac OS X is the unix command screencapture, which can be used to take screenshots in exactly the same way as pressing Command-Shift-3.  Unfortunately it requires you to give it a path to a file, rather than defaulting to saving the screenshot to the desktop in the form of 'Picture N', so I had to code something in there to make it do that on its own.  But here are three AppleScripts you can use with xGestures (or anything that can run AppleScripts, like Quicksilver) for taking screenshots:

This will take a screenshot normally, just like pressing Command-Shift-3:

repeat with i from 1 to 999
    set pathToTest to ("~/Desktop/Picture\\ " & i & ".png")
    try
        do shell script ("/bin/ls " & pathToTest)
    on error
        exit repeat
    end try
end repeat
do shell script "screencapture " & pathToTest



To make it behave like pressing command-shift-4, replace the last line with:
do shell script "screencapture -i " & pathToTest

or to make it behave like pressing command-shift-4-space, replace the last line with:
do shell script "screencapture -iW " & pathToTest

Hopefully someone might find these useful.  There's some other AppleScripts I wrote in response to user questions for xGestures, and at some point in the future I'll probably post them, since other people might like to have them too.