Skip to Main Content
IBM Power Ideas Portal


This portal is to open public enhancement requests against IBM Power Systems products, including IBM i. To view all of your ideas submitted to IBM, create and manage groups of Ideas, or create an idea explicitly set to be either visible by all (public) or visible only to you and IBM (private), use the IBM Unified Ideas Portal (https://ideas.ibm.com).


Shape the future of IBM!

We invite you to shape the future of IBM, including product roadmaps, by submitting ideas that matter to you the most. Here's how it works:

Search existing ideas

Start by searching and reviewing ideas and requests to enhance a product or service. Take a look at ideas others have posted, and add a comment, vote, or subscribe to updates on them if they matter to you. If you can't find what you are looking for,

Post your ideas
  1. Post an idea.

  2. Get feedback from the IBM team and other customers to refine your idea.

  3. Follow the idea through the IBM Ideas process.


Specific links you will want to bookmark for future use

Welcome to the IBM Ideas Portal (https://www.ibm.com/ideas) - Use this site to find out additional information and details about the IBM Ideas process and statuses.

IBM Unified Ideas Portal (https://ideas.ibm.com) - Use this site to view all of your ideas, create new ideas for any IBM product, or search for ideas across all of IBM.

ideasibm@us.ibm.com - Use this email to suggest enhancements to the Ideas process or request help from IBM for submitting your Ideas.

Status Not under consideration
Workspace IBM i
Categories Languages - RPG
Created by Guest
Created on Nov 5, 2020

Add %FKEY Built-in Function to RPG IV

In RPG IV when working with Screens, we see programmers using *INKx response indicators, *INxx regular indicators, and the WSDS Pos(369) to determine which Fn key was pressed.
RPG needs a built-in function, %FKEY() that allows users to test which key was pressed. The parameter could be with simple Fn values, or *Fn if that's easier. For example:
EXFMT ASKUSER;
IF %FKEY(F3);
return;
endif;
or...
If %FKEY(*F3);
return;
endif;
Another less desirable but acceptable syntax would be:
IF %FKEY() = *F3;
return;
endif;


Use Case:

With the consolidation of IBM i developer talent evolving from homogenous shops to the mix of 40-year talent, S/38 experience, S/36 users, and new YiP developers all in one shop, programs are getting really ugly. CFxx key response is one thing contributing to that deterioration.


Idea priority High
  • Guest
    Reply
    |
    Feb 10, 2022

    As you can see from the vote count on this RFE, the "not woth the benefit" is an incorrect opinion and it should be reconsidered.

  • Guest
    Reply
    |
    Mar 25, 2021

    ;(
    If the cost to implement it is too high, then either I'm not seeing where the cost would be or perhaps the techniques selected to implement were not optimal?

    1) Add the %FKEY or %FN built-in function with 1 parameter a character.
    2) Allow that character to be either a built-in Figurative Constant, like *F3 or a 1-byte value that is the AID Byte value for the various Fn keys.
    3) At runtime compare that value to the WSDS value returned in position 369.

    That's like 10 lines of code (okay not really "10 lines" but you get my point). It doesn't need to be a new capability. Please reconsider as the number of votes indicates that it is something that is desired by the community.

  • Guest
    Reply
    |
    Mar 11, 2021

    IBM does not intend to provide a solution to this request at this time, so it is being closed.

    The cost to implement this request would not be worth the benefit, since there is already more than one way to accomplish the goal of determining whether a particular function key was pressed.

  • Guest
    Reply
    |
    Feb 3, 2021

    The INDDS allows you to use descriptive names.
    Example:
    DCL-DS WSDS QUALIFIED;
    Exit IND POS(3);
    SearchEntry IND POS(4);
    Refresh IND POS(5);
    NewEntry IND POS(6);
    CommandLine IND POS(9);
    Cancel IND POS(12);
    JumpTop IND POS(17);
    JumpBottom IND POS(18);
    SubfileClear IND POS(30);
    SubfileDisplayControl IND POS(31);
    SubfileDisplay IND POS(32);
    SubfileMore IND POS(33);
    END-DS;

    Select;
    When WSDS.Exit;
    // Do stuff
    EndSl;

    So i think this option is much better than a %FKEY(*F3) or similar.

  • Guest
    Reply
    |
    Jan 5, 2021

    @eckersleyd, please correct me if I'm mistaken, but I believe mouse events are reported in the AID byte of the INFDS as whatever function key F1, F2 etc they are mapped to in the display file. If so, it would not be possible for RPG to know whether it was a mouse event or a function key that caused that particular value.

  • Guest
    Reply
    |
    Jan 5, 2021

    If you chose to implement this then please make it possible to set and disable it.

    For example:
    eval %FKEY(*F12) = '0'
    eval %FKEY(*ENTER) = '1'
    eval %FKEY(*F3) = *ON

  • Guest
    Reply
    |
    Dec 30, 2020

    I'm sure that the mouse events can be used with this as well? if %fkey(*E01), for example?

  • Guest
    Reply
    |
    Dec 9, 2020

    Due to processing by IBM, this request was reassigned to have the following updated attributes:
    Brand - Servers and Systems Software
    Product family - Power Systems
    Product - IBM i
    Component - Languages - RPG
    Operating system - IBM i
    Source - None

    For recording keeping, the previous attributes were:
    Brand - Servers and Systems Software
    Product family - Power Systems
    Product - IBM i
    Component - Application Development
    Operating system - IBM i
    Source - None

  • Guest
    Reply
    |
    Dec 9, 2020

    Using a *F3 *PAGEUP *PAGEDN *ROLLUP *ROLLDN *ENTER *PRINT, *HOME (don't forget the HOME key) and so in is perfect.

    EXFMT Display;
    IF %FKEY(*F3);
    return;
    endif;
    // Happy Days!

    Please note that although the *xx (leading asterisk) is acceptable, since I assume IBM will just map *F3 to X'33' and the built-in will simply test the equivalent of the WSDS for X'33'. This would mean *F3... *ENTER etc. should be available as figurative constants outside of the %FKEY() built-in function, correct?

  • Guest
    Reply
    |
    Dec 1, 2020

    IBM has received the requirement and is evaluating it. IBM will provide a response after evaluation is complete.

    If this is implemented, the syntax would use special values like *F3: %FKEY(*F3), %FKEY(*F24), %FKEY(*PRINT)

  • Guest
    Reply
    |
    Nov 12, 2020

    I'm assuming the definition of a function key would also include the Page Up/Down keys, Enter key, etc.

  • Guest
    Reply
    |
    Nov 12, 2020

    I don't enjoy dismissing comments, but clearly as the guy who documented the X'33' and all the Fn key values/scan codes back in 1987 and showed how position 369 of the WSDS can be used, I'm verify familiar with the WSDS approach. The other suggestion of "mapping indicator array" cause me the throw up in my mouth a little. Who would do that if they didn't have to? (and you don't have to.)

    By adding the %FKEY() built-in, it becomes standard and available to everyone as the standard way to code and respond to Fn keys. Is it better than "your way"? Of course it is.

  • Guest
    Reply
    |
    Nov 6, 2020

    This request doesn't add anything to readability.

    Overlay the indicator array with an array of named indicators and give them proper names. That would add some readability to it. And that can already be done with adding more **** to the compiler.

  • Guest
    Reply
    |
    Nov 6, 2020

    What's wrong with...

    Dcl-C F3 Const(X'33');

    If WInfDS.Key = F3;

    The readability is almost identical.