FLTK logo

[master] 22cb8a7 - Make Fl_Input::handle_key() protected (#203)

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.commit  ]
 
Previous Message ]Next Message ]

[master] 22cb8a7 - Make Fl_Input::handle_key() protected (#203) "Albrecht Schlosser" Apr 07, 2021  
 
commit 22cb8a7fdb1dfd5cb9e8280ce858dc6803bcdd9d
Author:     Albrecht Schlosser <albrechts.fltk@online.de>
AuthorDate: Wed Apr 7 19:14:25 2021 +0200
Commit:     Albrecht Schlosser <albrechts.fltk@online.de>
CommitDate: Wed Apr 7 19:14:25 2021 +0200

    Make Fl_Input::handle_key() protected (#203)
    
    ... as requested in this comment:
    https://github.com/fltk/fltk/issues/211#issuecomment-814235771

 FL/Fl_Input.H    |  7 ++++---
 src/Fl_Input.cxx | 16 ++++++++++++----
 2 files changed, 16 insertions(+), 7 deletions(-)

diff --git FL/Fl_Input.H FL/Fl_Input.H
index f165ddc..0967d33 100644
--- FL/Fl_Input.H
+++ FL/Fl_Input.H
@@ -1,7 +1,7 @@
 //
 // Input header file for the Fast Light Tool Kit (FLTK).
 //
-// Copyright 1998-2010 by Bill Spitzak and others.
+// Copyright 1998-2021 by Bill Spitzak and others.
 //
 // This library is free software. Distribution and use rights are outlined in
 // the file "COPYING" which should have been included with this file.  If this
@@ -34,7 +34,7 @@
   Character composition is done using dead keys and/or a compose
   key as defined by the operating system.
   <P>
- <!-- DON'T use the class name in the caption, or doxygen 1.8.x will fail. -->
+  <!-- DON'T use the class name in the caption, or doxygen 1.8.x will fail. -->
   <TABLE WIDTH="90%" BORDER="1" SUMMARY="Fl_Input keyboard and mouse bindings.">
     <CAPTION ALIGN="TOP">Keyboard and mouse bindings.</CAPTION>
     <TR><TD NOWRAP="NOWRAP" WIDTH="1%">
@@ -220,7 +220,6 @@
 class FL_EXPORT Fl_Input : public Fl_Input_ {
   friend class Fl_Screen_Driver;
   friend class Fl_Cocoa_Screen_Driver; // Not ideal, but probably no other platform will use it
-  int handle_key();
   int shift_position(int p);
   int shift_up_down_position(int p);
   void handle_mouse(int keepmark=0);
@@ -257,6 +256,8 @@ class FL_EXPORT Fl_Input : public Fl_Input_ {
 
 protected:
   void draw();
+  int handle_key();
+
 public:
   int handle(int);
   Fl_Input(int,int,int,int,const char * = 0);
diff --git src/Fl_Input.cxx src/Fl_Input.cxx
index 9a3342e..5fa16bf 100644
--- src/Fl_Input.cxx
+++ src/Fl_Input.cxx
@@ -1,7 +1,7 @@
 //
 // Input widget for the Fast Light Tool Kit (FLTK).
 //
-// Copyright 1998-2020 by Bill Spitzak and others.
+// Copyright 1998-2021 by Bill Spitzak and others.
 //
 // This library is free software. Distribution and use rights are outlined in
 // the file "COPYING" which should have been included with this file.  If this
@@ -300,9 +300,17 @@ int Fl_Input::kf_copy_cut() {
   return cut();
 }
 
-// Handle a keystroke.
-//     Returns 1 if handled by us, 0 if not.
-//
+/** Handles a keystroke.
+
+  This \p protected method handles a keystroke in an Fl_Input or derived
+  class. It handles compose key sequences and can also be used e.g. in
+  Fl_Multiline_Input, Fl_Float_Input and several more derived classes.
+
+  The details are way too complicated to be documented here and can be
+  changed as required. If in doubt, please consult the source code.
+
+  \returns  1 if the keystroke is handled by us, 0 if not.
+*/
 int Fl_Input::handle_key() {
 
   char ascii = Fl::event_text()[0];
Direct Link to Message ]
 
     
Previous Message ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.