Through the keyboard, you would have to use a mouse simulator. Microsoft OS has one packaged in their OS called MouseKeys, it's under the Accessibility Options. You'll need to remap the buttons to whatever keys is used by MouseKeys.
Hardware wise, just hack the buttons from a mouse to your buttons.