From: Mathias Dahl <brakjoller.rem0veth1s@gmail.com>
Subject: Re: Toggle fullscreen with one key
Date: Fri, 18 Mar 2005 13:11:49 +0100 [thread overview]
Message-ID: <uy8clgnlm.fsf@gmail.com> (raw)
In-Reply-To: MPG.1ca43861f435e0c5989681@news1.comhem.se
Johan Josefsson <johan.mailinglists@gmail.com> writes:
> I am currently using two keys (f2 and C-f2) and two functions for
> maximizing and restoring the frame in win32:
> [...]
> It works as intended, but I wonder, is there any simple way to
> replace these two keys with a function that use only one key (f2) to
> toggle between these two states?
>
This is a bit ugly (one should really check the "real" state of the
frame), but works:
(defvar my-frame-toggle-state nil
"Just a dummy variable too keep track of things")
(defun my-frame-toggle ()
(interactive)
(if my-frame-toggle-state
(my-frame-restore)
(my-frame-maximize))
(setq my-frame-toggle-state (not my-frame-toggle-state)))
(defun my-frame-maximize ()
"Maximize Emacs window in win32"
(interactive)
(w32-send-sys-command ?\xf030))
(defun my-frame-restore ()
"Restore Emacs window in win32"
(interactive)
(w32-send-sys-command ?\xF120))
/Mathias
next prev parent reply other threads:[~2005-03-18 12:11 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-03-17 23:56 Toggle fullscreen with one key Johan Josefsson
2005-03-18 0:57 ` Drew Adams
2005-03-18 1:08 ` Pascal Bourguignon
2005-03-18 12:11 ` Mathias Dahl [this message]
2005-03-19 0:30 ` rgb
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=uy8clgnlm.fsf@gmail.com \
--to=brakjoller.rem0veth1s@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).