Oolite
Loading...
Searching...
No Matches
MyOpenGLView(OOPrivate) Category Reference

Instance Methods

(void) - resetSDLKeyModifiers
 
(void) - setWindowBorderless:
 
(void) - handleStringInput:keyID:
 

Detailed Description

Definition at line 78 of file MyOpenGLView.m.

Method Documentation

◆ handleStringInput:keyID:

- (void) handleStringInput: (SDL_KeyboardEvent *)  kbd_event
keyID: (Uint16)  key_id 

Extends class MyOpenGLView.

Definition at line 50 of file MyOpenGLView.m.

2629 : (SDL_KeyboardEvent *) kbd_event keyID:(Uint16)key_id;
2630{
2631 SDL_Keycode key=kbd_event->key;
2632
2633 // Del, Backspace
2634 if((key == SDLK_BACKSPACE || key == SDLK_DELETE) && [typedString length] > 0)
2635 {
2636 // delete
2637 [typedString deleteCharactersInRange:NSMakeRange([typedString length]-1, 1)];
2638 }
2639
2640 isAlphabetKeyDown=NO;
2641
2642 // TODO: a more flexible mechanism for max. string length ?
2643 if([typedString length] < 40)
2644 {
2645 lastKeyShifted = shift;
2646 if (allowingStringInput == gvStringInputAlpha)
2647 {
2648 // inputAlpha - limited input for planet find screen
2649 if(key >= SDLK_A && key <= SDLK_Z)
2650 {
2651 isAlphabetKeyDown=YES;
2652 [typedString appendFormat:@"%c", key];
2653 // if in inputAlpha, keep in lower case.
2654 }
2655 }
2656 else
2657 {
2658 //Uint16 unicode = kbd_event->keysym.unicode;
2659 // printable range
2660 if (key_id >= 32 && key_id <= 255) // 126
2661 {
2662 if ((char)key_id != '/' || allowingStringInput == gvStringInputAll)
2663 {
2664 isAlphabetKeyDown=YES;
2665 [typedString appendFormat:@"%c", key_id];
2666 }
2667 }
2668 }
2669 }
2670}
@ gvStringInputAlpha
@ gvStringInputAll

◆ resetSDLKeyModifiers

- (void) resetSDLKeyModifiers

Extends class MyOpenGLView.

Definition at line 50 of file MyOpenGLView.m.

1404{
1405 // probably not needed for Linux
1406}

◆ setWindowBorderless:

- (void) setWindowBorderless: (BOOL)  borderless

Extends class MyOpenGLView.

Definition at line 50 of file MyOpenGLView.m.

1409 :(BOOL)borderless
1410{
1411 // do nothing on Linux
1412}

The documentation for this category was generated from the following file: