Browse
(440) 299-7778
Menu
(440) 299-7778
One-year parts and labor warranty30-day money-back guaranteeEnglishEspañolContact

The text of a manual · part 7 of 42

JANUS PSK for C/C++ Reference Manual, Version 2.1, pages 61 to 70

Pages 61 to 70 of 414

The original document is the PDF (690 KB). This is its text as extracted, unedited; tables and drawings read best in the PDF, and each page heading opens it at that page.

For the Intermec J2020, Intermec J2010 and Intermec J2050

Page 61

im_get_contrast

2

Example See example for im_set_contrast.

2-33

Page 62

im_get_control_key im_get_control_key Purpose:

You can enable or disable the Ctrl key. This procedure retrieves the current setting. When you disable this keycode, none of the key combinations that use the Ctrl key will work. For example, the warm boot key sequence Ctrl-Alt-Del will not work.

Syntax:

#include "im20lib.h" IM_STATUS im_get_control_key (IM_CONTROL *control_key);

IN Parameters:

None.

OUT Parameters:

The control_key parameter is one of these constants: IM_ENABLE IM_DISABLE

Ctrl key is enabled Ctrl key is disabled

Return Value:

This function returns one of the standard status codes defined in Appendix A, “Status Codes.”

See Also:

im_set_control_key

2-34

Page 63

im_get_control_key

2

Example /******************** im_get_control_key *******************************/ /* Also with: im_set_control_key */ #include <stdio.h> #include <conio.h> #include <stdlib.h> #include <ctype.h> #include "im20lib.h" void main (void) { IM_UCHAR user_option; IM_CONTROL old_controlkey; IM_CONTROL new_controlkey; clrscr(); gotoxy(1,1);

/* Clear screen */ /* Position message */

/* Get the current status of control key */ im_get_control_key(&old_controlkey); /* Display control key's status */ if (old_controlkey == IM_ENABLE) printf("<CTRL> key enabled!"); else printf("<CTRL> key disabled!"); /* Get user's input option, 'y' for enabling control key */ printf("\n\nEnabling <CTRL> key(y)?"); user_option = getche(); user_option = toupper(user_option); if (user_option == 'Y') { /* <CTRL> key enable */ im_set_control_key(IM_ENABLE); } else { /* <CTRL> key disable */ im_set_control_key(IM_DISABLE); } /* Get new <CTRL> key's status after setting */ im_get_control_key(&new_controlkey); /* Display user's input setting */ if (new_controlkey == IM_ENABLE) printf("\n<CTRL> key enabled!"); else printf("\n<CTRL> key disabled!"); printf("\nTest it>>\n"); }

2-35

Page 64

im_get_display_mode im_get_display_mode Purpose:

This function gets the size mode, video mode, scroll mode, and character height of the display.

Syntax:

#include "im20lib.h" IM_STATUS im_get_display_mode (IM_STD_SIZE_MODE *size_mode, IM_STD_VIDEO_MODE *video_mode, IM_SCROLL_MODE *scroll_mode, IM_CHARACTER_HEIGHT *char_ht);

IN Parameters:

None.

OUT Parameters:

The size_mode parameter is required and is one of these constants: IM_SIZE_MODE_80X25 IM_SIZE_MODE_20X16 IM_SIZE_MODE_20X8 IM_SIZE_MODE_10X16 IM_SIZE_MODE_10X8

80 x 25 text mode 20 x 16 text mode (2010 and 2020) 20 x 8 text mode (2010 and 2020) 10 x 16 text mode (2010 and 2020) 10 x 8 text mode (2010 and 2020)

If the size_mode parameter is set to IM_SIZE_MODE_80X25, the video mode, scroll mode, and character height values may have been customized. If any other size_mode is set, the video mode, scroll mode, and character height use the default values. The video_mode parameter requires IM_SIZE_MODE_80X25. The standard PC BIOS supports up to video mode 13H. The reader only supports up to video mode 6. You can also set video modes 0 through 3 with IC.EXE. The video_mode parameter is one of these constants: IM_STD_VIDEO_MODE_0 IM_STD_VIDEO_MODE_1 IM_STD_VIDEO_MODE_2 IM_STD_VIDEO_MODE_3 IM_STD_VIDEO_MODE_4 IM_STD_VIDEO_MODE_5 IM_STD_VIDEO_MODE_6

2-36

40 x 25 (use for double-wide character) 40 x 25 (use for double-wide character) 80 x 25 80 x 25 300 x 200 2-color 300 x 200 monochrome 640 x 200 2-color (2050)

Page 65

im_get_display_mode

2

The scroll_mode requires IM_SIZE_MODE_80X25 and is one of these constants: IM_LCD_SCROLL_AT_25 IM_LCD_SCROLL_AT_16 IM_LCD_SCROLL_AT_13 IM_LCD_SCROLL_AT_8

Scroll at line 25 Scroll at line 16 (2010 and 2020) Scroll at line 13 (2050 and double height) Scroll at line 8 (2010 and 2020)

The char_ht parameter requires IM_SIZE_MODE_80X25 and is one of these constants: IM_STANDARD_CHAR_HEIGHT

Standard height characters. On a JANUS 2050, up to 25 lines of these characters fit on the screen. On other JANUS readers, up to 16 lines fit on the screen.

IM_DOUBLE_CHAR_HEIGHT

Double height characters. On a JANUS 2050, up to 13 lines of these characters fit on the screen. On other JANUS readers, up to 8 lines fit on the screen.

Return Value:

This function returns one of the standard status codes defined in Appendix A, “Status Codes.”

See Also:

im_set_display_mode

Example See example for im_viewport_setxy.

2-37

Page 66

im_get_display_type im_get_display_type Purpose:

This function gets the hardware display type, either standard JANUS reader or JANUS 2050 (VMU).

Syntax:

#include "im20lib.h" IM_STATUS im_get_display_type (IM_DISPLAY_TYPE *type);

IN Parameters:

None.

OUT Parameters:

The type parameter is one of these constants: IM_LCD_20X16 IM_CRT_80X25

Standard JANUS display JANUS VMU display

Return Value:

This function returns one of the standard status codes defined in Appendix A, “Status Codes.”

See Also:

im_get_display_mode, im_set_display_mode

Example /******************** im_get_display_type *******************************/ #include <stdio.h> #include <string.h> #include "im20lib.h" void main(void) { IM_DISPLAY_TYPE type; IM_STATUS status; // Use im_get_display_type to get the Display Type printf("\nim_get_display_type example: \n"); status = im_get_display_type(&type); // Print the results if(type == IM_LCD_20X16) // Standard JANUS Display printf("\nDisplay type is Standard JANUS display"); else if(type == IM_CRT_80X25) // JANUS VMU Display printf("\nDisplay type is JANUS VMU display"); }

2-38

Page 67

im_get_follow_cursor

2 im_get_follow_cursor Purpose:

When the display is in 80 x 25 mode, the viewport follows the cursor as it moves. The follow-the-cursor feature can be enabled or disabled. This function retrieves the current setting.

Syntax:

#include "im20lib.h" IM_STATUS im_get_follow_cursor (IM_CONTROL *follow_cursor);

IN Parameters:

None.

OUT Parameters:

The follow_cursor parameter is one of these constants: IM_ENABLE IM_DISABLE

Follow-the-cursor mode is enabled Follow-the-cursor mode is disabled

Return Value:

This function returns one of the standard status codes defined in Appendix A, “Status Codes.”

Notes:

This function has no effect on the JANUS 2050.

See Also:

im_set_follow_cursor, im_cursor_to_viewport, im_viewport_to_cursor

2-39

Page 68

im_get_follow_cursor

Example /******************** im_get_follow_cursor *******************************/ /* Also with: im_set_follow_cursor */ #include <stdio.h> #include <conio.h> #include <stdlib.h> #include <ctype.h> #include "im20lib.h" #define

ESC_CHAR

0x1B void main (void) { IM_UCHAR ch, user_option; IM_CONTROL old_lock_cursor; IM_CONTROL new_lock_cursor; clrscr(); gotoxy(1,1);

/* Clear screen */ /* Position message */

/* Get the current status of viewport follow cursor for restore later */ im_get_follow_cursor(&old_lock_cursor); /* Get user's input option, 'y' for disable viewport follow cursor */ printf("Enable viewport\nfollows cursor(y)?"); user_option = getche(); user_option = toupper(user_option); if (user_option == 'Y') { /* Enable viewport follow cursor */ im_set_follow_cursor(IM_ENABLE); } else { /* Disable viewport follow cursor */ im_set_follow_cursor(IM_DISABLE); } /* Get new viewport follow cursor status after setting */ im_get_follow_cursor(&new_lock_cursor); /* Display user's input message */ printf("\n\n'ESC' to quit!\nType keys to check\n"); printf("viewport follow\n"); if (new_lock_cursor == IM_ENABLE) printf("cursor ON !!!!!"); else printf("cursor OFF !!!!"); /* Enter any characters to check viewport follow cursor until 'ESC' key. */ while ( (ch = getche()) != ESC_CHAR ) ; /* Restore original follow cursor setting */ im_set_follow_cursor(old_lock_cursor); }

2-40

Page 69

im_get_input_mode

2 im_get_input_mode Purpose:

This function reports the current mode of the input manager. The different modes affect how the reader interprets and stores input.

Syntax:

#include <im20lib.h> IM_MODE im_get_input_mode (void);

IN Parameters:

None.

OUT Parameters:

None.

Return Value:

The IM_MODE returned is one of these constants: IM_WEDGE IM_PROGRAMMER IM_DESKTOP

Notes:

Wedge mode Programmer mode Desktop mode

There are three different reader input modes: Wedge, Programmer, and Desktop. These different modes affect how the reader interprets and stores input. Wedge Mode Keypad and label inputs go into the keyboard buffer with minimal filtering. Wedge mode is the default mode at the DOS prompt after reader services (RSERVICE.EXE) is loaded. Use Wedge mode when the reader is running an application that uses the Virtual Wedge. When in this mode, use standard input functions to retrieve keypad or label input. Wedge mode does not take full advantage of the reader’s power management capabilities. You will probably notice reduced battery life when the reader is in this mode compared to either Programmer or Desktop mode. For more information on power management, see Chapter 4, “Advanced Programming.” Programmer Mode Inputs are echoed to the screen. Reader commands are executed and saved. Use Programmer mode when the reader is executing IRL commands. In general, when you are running an application that uses the function libraries or software interrupts, the reader should be in Programmer mode.

2-41

Page 70

im_get_input_mode

Desktop Mode The application is responsible for retrieving and displaying input. Use Desktop mode when you need detailed information about a pressed key. Each character returned consists of four bytes: the ASCII code, scan code, and two bytes for the keyboard flags (Shift, Ctrl, Alt). See the structure IM_KEYCODE in IM20LIB.H for further details. For more information about reader input modes, see Chapter 4, “Advanced Programming.” You must install the Reader Wedge to use this function. For information on loading RWTSR.EXE, see “Runtime Requirements” earlier in this chapter. See Also:

im_set_input_mode

Example See example for im_receive_input.

2-42