howto link an Arduino Light Sensor to a keyboard button
You need to write an Arduino sketch trigger on your sensor and send a message over the serial port to your PC. Then, you need some PC side software to interpret this message and fake a keyboard event.

Here's an example:
http://www.arkadian.eu/pages/375/arduino-based-keyboard-for-windows

The other method is to reprogram the atmega-u8 coprocessor on your UNO to emulate a USB keyboard directly. This is more complex and may require an AVR ISP programmer.

http://hunt.net.nz/users/darran/weblog/faf5e/Arduino_UNO_Keyboard_HID_part_2.html