print name to stdout on enter - lel - Farbfeld image viewer
 (HTM) git clone git://git.codemadness.org/lel
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) README
 (DIR) LICENSE
       ---
 (DIR) commit f5218c3944254bcfcb184de6ffff153fc4e61956
 (DIR) parent be0f93f92b7b36856acb9709b9ee550b89899db6
 (HTM) Author: Hiltjo Posthuma <hiltjo@codemadness.org>
       Date:   Sat,  2 Aug 2014 00:20:40 +0000
       
       print name to stdout on enter
       
       Signed-off-by: Hiltjo Posthuma <hiltjo@codemadness.org>
       
       Diffstat:
         M TODO                                |       2 +-
         M lel.c                               |       9 +++++++++
       
       2 files changed, 10 insertions(+), 1 deletion(-)
       ---
 (DIR) diff --git a/TODO b/TODO
       @@ -2,7 +2,7 @@
                [ ] alpha mask with png2if | lel is always black?
                [ ] resizing slow (might be a dwm issue).
        [ ] use XSHM again?
       -[ ] enter key or some other key should print the current filename to stdout.
       +[x] enter key or some other key should print the current filename to stdout.
        [ ] for pictures which use an alpha mask use a checked pattern, similar to:
            http://www.modejong.com/blog/Media/Ghost_TransparentBG_400x300.jpg
        [ ] improve lel-open to support multiple files.
 (DIR) diff --git a/lel.c b/lel.c
       @@ -381,6 +381,12 @@ buttonpress(XEvent *ev)
        }
        
        void
       +printname(void)
       +{
       +        printf("%s\n", cimg->filename);
       +}
       +
       +void
        keypress(XEvent *ev)
        {
                KeySym key;
       @@ -413,6 +419,9 @@ keypress(XEvent *ev)
                case XK_o:
                        setview(ASPECT);
                        break;
       +        case XK_Return:
       +                printname();
       +                break;
                case XK_f:
                        setview(FULL_STRETCH);
                        break;