Unless you're going to screw into the desk I wouldn't be trusting that.
Personally, if this was my desk, I'd create a similar set of holding brackets, but ones that hooked over the rear of the shelf.
I'll knock up a quick pic.
Summat like this:

The weight of the keyboard at the front keeps a balancing upward at the back. Additional pressure at the front (from playing) doesn't then cause it to move away from the shelf. The arms that go front to back can be shaped to go under your screen but over the mount. Hook the back in place, drop down the front, add your keyboard to make it secure.
Could either do as two separate arms (with a couple of horizontal studs for stability) or run a couple of bars between the two arms (probably what I'd do).
Could probably cut all of it out of a single length of 4x1, but I'd need to knock up a couple of scale drawings first.