It may not be possible with your setup--we'd need to know some more information about what equipment you are using. Specifically, the model number of your keyboard and pedal, or if you don't have the model number of the pedal, a picture of the pedal including the plug would suffice (you might be able to find it online).
Basically, most MIDI keyboard sustain pedals are binary ONLY--the pedal can only communicate on or off to the keyboard; nothing in-between. If the pedal in question came standard with your keyboard, there's a good chance it's binary only. For example, the M-Audio SP-2 is a basic keyboard-style sustain pedal that is on-off only.
Of course, MIDI keyboard manufacturers have been questing after the perfect acoustic facsimile forever, so it is possible to buy sustain pedals that are continuous from 0% to 100% (MIDI typically sees this as 0-127)--these are typically more expensive and require that you purchase them separately. The one I have at my feet is the Yamaha FC-3, and it did cost extra when I purchased my digital piano.
Now, that's not the only problem. If you examine carefully the pictures of the two products I linked above, you will notice that M-Audio pedal has a connector that is 1/4" TS (two conductor), while the Yamaha is 1/4" TRS (three conductor)--the continuous sustain requires an extra electrical contact, and this requires that your keyboard hardware be compatible.
As luck would have it, I have an M-Audio keyboard sitting next to me as well, and while I can't be sure if it's the same as yours, it is a basic model and the only jack it has in the rear is labeled "Sustain". That's a pretty good indication that it will only accept on-off sustain pedals (with a TS connector). If you also have a jack labelled "expression", chances are it will accept continuous 0-127 signals, and it might be possible to use the Yamaha pedal and program it to affect your sustain (instead of what would typically be volume). It should go without saying that higher-end Yamaha keyboards have extensive compatibility with their own hardware--you can plug the FC-3 into the sustain jack of any current Yamaha digital piano and it will behave like an acoustic piano's damper pedal.
One more thing...
Here are two suggestions you might be able to put into use to improve your situation, assuming you're using the same kind of low-end hardware that I had before I got my Yamaha digital piano:
- If you're familiar playing an acoustic piano and are sure you're pedaling accurately, you might want to look at the settings in your sampler--it's possible that you could add some reverb or decrease the sample decay to more approximate what you're used to.
2. Epic kludge method:
When I was using the M-Audio pedal and keyboard, I was okay with a binary (on/off) pedal, but I was very disappointed in the calibration of the pedal itself. I had been used to playing Steinway grand pianos in music school with a very short pedal throw and a very crisp response, instead of upright pianos with a large throw distance and very wide response. The SP-2 (which of course came in a package deal along with the keyboard) had the worst of both worlds: a huge throw distance and an immediate response at some indeterminate point in the throw that gave no physical feedback. My solution was to physically restrict the throw of the pedal so that it only covered the space immediately surrounding the trigger point. This took a considerable amount of trial and error especially given my less-than-efficient construction method of tape and paper, but the result looked like this:
See how gigantic the pedal throw is? I measure it to be about .75". Now, with my customized pieces in place:
The throw distance is reduced to < .25"! Notice that on my pedal the trigger point was very close to the ground. I was extremely happy with the improvement; since it took that much less muscle movement to indicate a difference between on and off, I could be much more precise with my pedaling, and I didn't feel like I had to pedal so effortfully. For the cost of the pedal, the springs inside are easily resilient enough to handle this mod, and I have no idea why M-Audio didn't just design their pedals this way in the first place.
As you all can tell, I've been wanting to write this answer for a while. :-)