Can I map right mouse click to another command?

I want to map right mouse click to go to definition.Is it possible?

sure : nmap <RightMouse> <Cmd>lua open_contextual_menu()<CR>

Thanks for your help!