danzeff OSK

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

twuking
Posts: 24
Joined: Thu Jun 22, 2006 7:27 pm

Post by twuking »

danzeff.h

Code: Select all

#ifndef INCLUDED_KEYBOARDS_DANZEFF_H
#define INCLUDED_KEYBOARDS_DANZEFF_H

//danzeff is BSD licensed, if you do make a new renderer then please share it back and I can add it
//to the original distribution.

//Set which renderer target to build for
/* #define DANZEFF_SDL */
 #define DANZEFF_SCEGU 



//the SDL implementation needs the pspctrl_emu wrapper to convert
//a SDL_Joystick into a SceCtrlData
#ifdef DANZEFF_SDL
#include "pspctrl_emu.h"
#else //not DANZEFF_SDL
#include <pspctrl.h>
#endif //DANZEFF_SDL

#ifdef __cplusplus
extern "C" &#123;
#endif

//Initialization and de-init of the keyboard, provided as the keyboard uses alot of images, so if you aren't going to use it for a while, I'd recommend unloading it.
void danzeff_load&#40;&#41;;
void danzeff_free&#40;&#41;;

//returns true if the keyboard is initialized
/*bool*/ int danzeff_isinitialized&#40;&#41;;

/** Attempts to read a character from the controller
* If no character is pressed then we return 0
* Other special values&#58; 1 = move left, 2 = move right, 3 = select, 4 = start
* Every other value should be a standard ascii value.
* An unsigned int is returned so in the future we can support unicode input
*/
unsigned int danzeff_readInput&#40;SceCtrlData pspctrl&#41;;
#define DANZEFF_LEFT   1
#define DANZEFF_RIGHT  2
#define DANZEFF_SELECT 3
#define DANZEFF_START  4

//Move the area the keyboard is rendered at to here
void danzeff_moveTo&#40;const int newX, const int newY&#41;;

//Returns true if the keyboard that would be rendered now is different to the last time
//that the keyboard was drawn, this is altered by readInput/render.
/*bool*/ int danzeff_dirty&#40;&#41;;

//draw the keyboard to the screen
void danzeff_render&#40;&#41;;


///Functions only for particular renderers&#58;

#ifdef DANZEFF_SDL ///Functions only for SDL Renderer
#include <SDL/SDL.h>
#include <SDL/SDL_image.h>
//set the screen surface for rendering on.
void danzef_set_screen&#40;SDL_Surface* screen&#41;;
#endif //DANZEFF_SDL


#ifdef __cplusplus
&#125;
#endif

#endif //INCLUDED_KEYBOARDS_DANZEFF_H
sandberg
Posts: 90
Joined: Wed Oct 05, 2005 1:25 am
Location: Denmark

Post by sandberg »

You need to setup the GU correctly and setup the display/framebuffers etc. Which is not done in your program.

Take one of the examples from the pspsdk in the samples/gu directory to see how they're implemented.
Br, Sandberg
Nerd42
Posts: 9
Joined: Thu Jul 10, 2008 2:09 am

Post by Nerd42 »

I want DosBox with this keyboard!! :)
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post by J.F. »

It's really easy to do. I added danzeff to Basilisk rather easily, and it works well.
sakya
Posts: 190
Joined: Fri Apr 28, 2006 5:48 pm
Contact:

Post by sakya »

Hi! :)

I added OSLib to the Danzeff OSK. :)
Here you can find the source and a sample eboot:
http://www.sakya.it/downloads/DanzeffOSLib.rar

Ciaooo
Sakya
Ixar
Posts: 11
Joined: Tue Sep 26, 2006 8:23 pm

Post by Ixar »

I just thought of something, maybe crazy... please tell me.

Would it be possible to hook the input method provided by the psp firmware with OSK ? Do you have such a firmware hook source code somewhere I can see how to do it for the keyboard ?

Thanks.
User avatar
jean
Posts: 489
Joined: Sat Jan 05, 2008 2:44 am

Post by jean »

Would it be possible to hook the input method provided by the psp firmware with OSK ?
I was doing something similar, but then i leaved it due to lack of time. Pick up prxtool and analyze what functions do program using sony's OSK call (or alternatively, search for some osk homebrew demo). Then implement your own interface and hook old functions with yours (see pikey to learn how to do syscalls hook). If you succeed, please, leave me a note.
Jean
Post Reply