You can define a key only for org-mode by using org-defkey, basically add the following to your init file
(org-defkey org-mode-map [f5] 'org-reveal-export-to-html)
UPDATE
You can use file local variables.
(defvar export-with-reveal nil)
(defun export-with-reveal-or-html ()
(interactive)
(if (or export-with-reveal (file-exists-p "reveal.js"))
(call-interactively 'org-reveal-export-to-html)
(call-interactively 'org-export-as-html)))
(org-defkey org-mode-map [f5] 'export-with-reveal-or-html)
The function export-with-reveal-or-html
if the variable export-with-reveal
has value t or there is a file 'reveal.js' relative to org file , if so it exports with reveal
or it falls back to default html export. You can specify a file to exported as reveal by adding the following to top of your org file
# -*- export-with-reveal: t -*-
UPDATE 2
You can also define arbitrary export function by doing using, file-local variables
(defvar my-export-fn nil)
(defun my-export ()
(interactive)
(if my-export-fn
(call-interactively my-export-fn)
(call-interactively 'org-export-as-html)))
(org-defkey org-mode-map [f5] 'my-export)
Then at top of the file you can set the export function you want to use eg
# -*- export-fn: org-reveal-export-to-html -*-