Jumping off the sides of objects?

Hello, everyone. I'm having a few issues with my current platforming engine.

In my contactlistener I have the following:

Code:
override public function Persist(point:b2ContactPoint):void
      {
         if (point.shape1.GetUserData() == "groundsensor" || point.shape2.GetUserData() == "groundsensor") {
            canjump = true;
         }
      }
      override public function Remove(point:b2ContactPoint):void {
         if (point.shape1.GetUserData()=="groundsensor"||point.shape2.GetUserData()=="groundsensor") {
            canjump=false;
         }
      }


And when the up key is pressed and canjump is true, I just apply an impulse of (0, -5). The problem is, when I jump up while climbing up a diagonal slope, or while running into a wall, I skyrocket into the air. Is there any way of fixing this? Thanks in advance!
Check this out
viewtopic.php?f=8&t=5057
you could also create a separate foot shape for your hero, and test for its collisions.

as seen here, (from a post asking questions about jumping problems, however accidental wall jumping is not one of the problems in it)
http://megaswf.com/view/747face972e7cc6 ... 9e1f5.html
from this post
http://www.box2d.org/forum/viewtopic.ph ... 921#p23921
I'm already using a separate foot sensor, but apparently I have a completely different problem with my jumping engine I need to work out... the body bumps into the foot, and the game interprets that as being able to jump, so if this happens he can jump forever. I made the foot smaller, which worked until I realized this prevented me from jumping up steep paths. Hmm...
in that case Frnk's post which links you to how to detect impulse direction should help you.

Original thread: https://box2d.org/forum/viewtopic.php?t=5068