Beispiel #1
0
void ImageModel::FlipVertically()
{
    CopyPrevious();
    StretchBlt(hDrawingDC, 0, GetHeight() - 1, GetWidth(), -GetHeight(), GetDC(), 0, 0,
               GetWidth(), GetHeight(), SRCCOPY);
    NotifyImageChanged();
}
Beispiel #2
0
void ImageModel::InvertColors()
{
    RECT rect = {0, 0, GetWidth(), GetHeight()};
    CopyPrevious();
    InvertRect(hDrawingDC, &rect);
    NotifyImageChanged();
}
Beispiel #3
0
void ImageModel::RotateNTimes90Degrees(int iN)
{
    if (iN == 2)
    {
        CopyPrevious();
        StretchBlt(hDrawingDC, GetWidth() - 1, GetHeight() - 1, -GetWidth(), -GetHeight(), GetDC(),
                   0, 0, GetWidth(), GetHeight(), SRCCOPY);
    }
    NotifyImageChanged();
}
Beispiel #4
0
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////  This Function Finds The Character in The Tables in Found Calls     /////////////////////////////
/////////////////////////////  The Display Functions With Position (i),and The Starting Position  /////////////////////////////
/////////////////////////////  Of The Of The Message To Be Posted The Argument 					  /////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
int FindCharacters(char ch) 
{       
//	HWND  myWnd;  //---------Window Handel---//
    int	v_bit = 0;
	int no_bs = 0;//-------number of back spae--------//
	int glp_pos = 0; //---Glyph position ----//
	BOOL bHandledKeystroke = FALSE;
	kFlag.found = 0;

	
	if(ch == '~' && (kFlag.previous_0 == 'P' || kFlag.previous_0 == 'j'))
	{
			if(kFlag.previous_0 == 'j')
			{
				DisplaySingleCharacter(243);
			}
			else
			{
				SendBackSpace(1);
				DisplayDoubleCharacter(243,192);
			}
			kFlag.lastglyph = TRUE;
			return bHandledKeystroke;
	}
  
    if(ch == 'I' || ch == 'O' || ch == 'E')
	{ 
		if(ch == 'I' && kFlag.s_bit == TRUE)
		{
			DisplaySingleCharacter(70);
			kFlag.s_bit = FALSE;
			return bHandledKeystroke;
		}
		else
			DisplaySingleCharacter(195);
		return bHandledKeystroke;

		switch(kFlag.previous_0)
		{
		case 'i':
		case 'o':
		case 'e':
		DisplaySingleCharacter(195);
		return bHandledKeystroke;
		}

	if(kFlag.ipressed == TRUE)
		{
		kFlag.ipressed = FALSE;
		}
	 kFlag.ipressed	= FALSE;
	}

	
	if(ch == '~')
	{
	/*	if(kFlag.ei_bit == TRUE)
		{
			
			DisplaySingleCharacter(247);
			DisplaySingleCharacter(202);
			kFlag.ei_bit = 0;
			return bHandledKeystroke;
		}
		if(kFlag.c_bit == 1 || kFlag.o_bit == 1)
		{   
			DisplaySingleCharacter(246);
			DisplaySingleCharacter(200);
			kFlag.c_bit = 0;
		}
		else*/
		{
			DisplayDoubleCharacter(73,196);
			kFlag.found = TRUE;
			return bHandledKeystroke;
		}

	}
	if(ch == '`')
	{
		
		//	DisplaySingleCharacter(246);
			DisplaySingleCharacter(200);
			kFlag.c_bit = 0;
			return bHandledKeystroke;
	}

     switch(ch)
	 {
	 case 'F' :	
		 if(kFlag.c_bit == 1)
		DisplayCharacters_f(ch) ;
		kFlag.c_bit = 0;
	break ;
	case 'R' :	
			DisplaySingleCharacter(240);
		return bHandledKeystroke;
	case 'f':
		 kFlag.f_bit = 1;
		 return bHandledKeystroke;
	 }
    

    for(int i=0;i<=2;i++)
		 if(ch==anuswaranvisarga[i].key)
		 {  kFlag.found = 1;
			
				DisplayCharacters(i,ANUSWARA,0);
		 }
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  if((ch == 'A'))
  {    

	  if(kFlag.c_bit == 1)
		  return bHandledKeystroke;
	  DisplaySingleCharacter(67);
	  kFlag.found = 1;
	  return bHandledKeystroke;
  }
  		 
		 
   if(kFlag.found == 0)
    for(int i=0;i<=16;i++)
	if(ch==vowels[i].key)
	 {  
		switch(ch)
		 {  
			 case 'a':
			 case 'I':
			 case 'i':
			 case 'u':
			 case 'U':
			 case 'e':
		     case 'o':
			 case 'Z':
			 case 'V':
			 case '~':
			 if((kFlag.space_bit== 1)&&(kFlag.c_bit == 0))
			 {
			 DisplayCharacters(i,VOWELS,0);
			 kFlag.found  = 1;
			 kFlag.c_bit = 0;
			 kFlag.space_bit = 0;
			 }
			 break;

			 case 'Y':
			 case 'z':
			 case 'R':
			 if(kFlag.c_bit == 0)
			 {
			 DisplayCharacters(i,VOWELS,0);
			 kFlag.found  = 1;
			 kFlag.c_bit = 0;
			 kFlag.space_bit = 0;
			 }
    		 break;
		}
	 if(kFlag.found == 0)
 	 if(kFlag.c_bit == 1)
	 {           
                            
							switch(ch)
							{	
							case  'u' :
							case  'U' :
							case  '~' :
								 kFlag.n_back = -1;
				
							break;
						    default :
							kFlag.n_back = 1;
							}//-------------End of Switch------------//

							switch(ch)
							{	
							case 'i':
							case 'o':
							    kFlag.ipressed		 = 1;
							break;
							case 'e' :
								kFlag.ipressed		 = 1;
								kFlag.ei_bit = 1;
							}
		
					       if(ch == '~')
						   {							
									kFlag.s_bit = 1;
									vowels[i].k_val[3] = 200;
									DisplayCharacters(i,VOWELS,3);
							}//----------------End of if(ch == R)-----------------//
						   else
							   
							if(ch == 'i' || ch == 'I')                   //---If an i is pressed after a consonant---//
							{   
								kFlag.ipressed		 = 1;
								kFlag.n_back = -1;
								DisplayGunisu(ch);
							}
							else

							switch (kFlag.previous_0)   
							{
	   						case 'b' :
								SetGlyphs(ch,167);					//This function sets the glyph 
								kFlag.n_back = -1;                    //---patterns for thes specified characters
								DisplayCharacters(i,VOWELS,3) ;
							break;
						    case 'K' :
								SetGlyphs(ch,82);					//This function sets the glyph 
								kFlag.n_back = -1;                    //---patterns for thes specified characters
								DisplayCharacters(i,VOWELS,3) ;
							break;
							case 'j' :
								SetGlyphs(ch,100);
								kFlag.n_back = 0;
								DisplayCharacters(i,VOWELS,3) ;
							break;
							case 'q' :
								SetGlyphs(ch,108);
								DisplayCharacters(i,VOWELS,3) ;
							break;
							case 'N' :
								SetGlyphs(ch,116);
								DisplayCharacters(i,VOWELS,3) ;
							break;
							case 'l' :
								SetGlyphs(ch,174);
								DisplayCharacters(i,VOWELS,3) ;
							break;
							case 'J' :					//----For the characters ya ,ma,Jha,---//
							case 'm' :
         										//---ch the character and i the position in the vowles tab
						       	SetGlyphs_for_jmy(ch,i);
							break;
							case 'y' :
								SetGlyphs_for_jmy(ch,i);
							break;
							default :	
								//---For all other characters---//
							glp_pos = 3;
							switch(kFlag.previous_0)  //---------For Characters hu,vu,pu,Pu-------//
							{
							case 'p':
							case 'P':
							case 'v':
							case 'h':
								if(ch=='u'||ch=='U'||ch=='o'||ch=='O')
									glp_pos = 7;
								else
									glp_pos = 3;
							break;//-------add this to netravathi also---------//
							}

						/*	if(ch == 'i'||ch == 'o' || ch == 'e')
							{
							kFlag.derg_bit 	= 1;
							kFlag.derg_count 	= 1;
							}*/

							 DisplayCharacters(i,VOWELS,glp_pos) ;		    //---Display --Glyphs from 3----//
						   }   									   ///----------pevious_0 value put to next line of c_bit
						   kFlag.c_bit = 0;									///-------------Changed from last 
	 } //--------End of if C_bit ==1---------------//
    kFlag.c_bit = 0;									///-------------Changed from last 
	kFlag.q_bit = 0; ///for second voottakshara ////
	kFlag.so_bit = 0; // to set default for ra votakshara
	}//-------------End of ch == vowels[i]----------------// 
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
     if(kFlag.found == 0)
	 for(int i=0;i<=34;i++)
		 if(ch==consonants[i].key)
		 {   
			 kFlag.found = 1;
			
			    if(kFlag.f_bit == 1)
				{   
					if(kFlag.q_bit == TRUE)
					{
						DisplaySingleCharacter(246);
						kFlag.q_bit = 0;
					}
					
							 switch(ch)
							 {
							 case 'r':
								 if(kFlag.so_bit == 1)
								 {
							 	 kFlag.so_bit = 0;	
							 	 consonants[i].k_val[5] = 231;
								 }
								 else
								 {
								 consonants[i].k_val[5] = 230;
								 }
							 break;
							 default:
							  	kFlag.so_bit = 1;				//---------Otherwise it is second vttakshara ---------//
							 }
						 if(kFlag.previous_0 == 'Y') // if previous is an iitwa 
						 {
							 SendBackSpace(1);
							 DisplayCharacters(i,CONSONANTS,5);
							 DisplayDoubleCharacter(246,202);///display iitwa
						 }
						 else
						 if(kFlag.previous_1 == 'Y') // if previous is an iitwa 
						 {
							 SendBackSpace(2);
							 DisplayCharacters(i,CONSONANTS,5);
							 DisplayDoubleCharacter(246,202);///display iitwa
						 }
						 else
						 DisplayCharacters(i,CONSONANTS,5);
						 kFlag.f_bit = 0;
						 kFlag.c_bit = 0;
						 kFlag.o_bit = 1;
						 kFlag.q_bit = 1; ///for second voottakshara ////
				} //End Of kFlag.f_bit == 1
				else
				{  
					kFlag.c_bit = 1;
					DisplayCharacters(i,CONSONANTS,0);
					kFlag.ei_bit = 0;
					kFlag.o_bit = 0;
					kFlag.q_bit = 0; ///for second voottakshara ////
				}
		 }

    if(isalpha(ch)&&!(kFlag.f_bit)&&!(ch == 'F'))
	CopyPrevious(ch);
	if(isspace(ch))
	{
		kFlag.space_bit 		= 1;
		kFlag.c_bit = 0; //----------Add this and to above vowels for netravathi 
		kFlag.o_bit = 0;
		kFlag.f_bit = 0;
		kFlag.ipressed		 = 0;
		kFlag.ei_bit = 0;
	}
	if(!(isspace(ch))&&!(GetKeyState(VK_SHIFT)))
	 {
		 kFlag.space_bit 		= 0;
	     //c_bit = 0;
	 }
	return bHandledKeystroke;

}
Beispiel #5
0
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////  This Function Finds The Character in The Tables in Found Calls     /////////////////////////////
/////////////////////////////  The Display Functions With Position (i),and The Starting Position  /////////////////////////////
/////////////////////////////  Of The Of The Message To Be Posted The Argument 					  /////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
int FindCharacters(char ch)
{

    int no_bs = 0;//-------number of back spae--------//
    BOOL bHandledKeystroke = FALSE;
    kFlag.found = 0;
    no_bs = kFlag.o_count;



    if(kFlag.s_bit == TRUE)
    {
        kFlag.s_bit = FALSE;
        if(kFlag.previous_0 == '>')
        {
            kFlag.found = TRUE;
            DisplayDoubleCharacter(100,213);
            return bHandledKeystroke ;
        }
        /*		for(int i=0;i<43;i++)
        		{
        			if(ch == numerals[i].key)
        			{
        				kFlag.found = TRUE;
        				DisplaySingleCharacter(numerals[i].k_val[0]);
        				return bHandledKeystroke ;
        			}
        		}*/
    }

    if(kFlag.found == FALSE)
    {
        if((ch == 'f' && kFlag.previous_0 == '7') )
        {
            kFlag.found = TRUE;
            SendBackSpace(1);
            DisplaySingleCharacter(199);
        }
        else if( (ch == 'f' && kFlag.previous_0 == '8') || ch == 'f' && kFlag.previous_0 == '/' && kFlag.previous_1 == '8')
        {
            kFlag.found = TRUE;
            SendBackSpace(1);
            DisplaySingleCharacter(199);
        }
        /*  else
          if(ch == 'f' && kFlag.previous_0 == 'u' && kFlag.c_bit == TRUE)
          {
           kFlag.found = TRUE;
           kFlag.c_bit = FALSE;
           SendBackSpace(1);
           DisplaySingleCharacter(198);
          }*/
        else if(ch == 'e' && kFlag.previous_0 == '/' && kFlag.previous_1 == 'd')
        {
            kFlag.found = TRUE;
            SendBackSpace(3);
            DisplayDoubleCharacter(114,115);
        }
        else if(ch == 'e' && kFlag.previous_0 == '/' && kFlag.previous_1 == ',')
        {
            kFlag.found = TRUE;
            SendBackSpace(3);
            DisplayDoubleCharacter(162,115);
        }
        else if(ch == 'e' && kFlag.previous_0 == '/' && kFlag.previous_1 == 'p')
        {
            kFlag.found = TRUE;
            SendBackSpace(3);
            DisplayDoubleCharacter(166,252);
        }
        else if(ch == 'e' && kFlag.previous_0 == '/' && kFlag.previous_1 == 'b')
        {
            kFlag.found = TRUE;
            SendBackSpace(3);
            DisplayDoubleCharacter(169,252);
        }
        else if(ch == 'F' && kFlag.previous_0 == '/' && kFlag.previous_1 == 'C')
        {
            kFlag.found = TRUE;
            SendBackSpace(1);
            DisplaySingleCharacter(210);
        }
        else if(ch == 'F' && kFlag.previous_0 == '/' && kFlag.previous_1 == 'D')
        {
            kFlag.found = TRUE;
            SendBackSpace(1);
            DisplaySingleCharacter(217);
        }
        else if(ch == 'F' && kFlag.previous_0 == '/' && kFlag.previous_1 == ',')
        {
            kFlag.found = TRUE;
            SendBackSpace(1);
            DisplaySingleCharacter(222);
        }
        else if(ch == 'F' && kFlag.previous_0 == '/' && kFlag.previous_1 == 'P')
        {
            kFlag.found = TRUE;
            SendBackSpace(1);
            DisplaySingleCharacter(225);
        }
        else if(ch == 'F' && kFlag.previous_0 == '/' && kFlag.previous_1 == 'B')
        {
            kFlag.found = TRUE;
            SendBackSpace(1);
            DisplaySingleCharacter(227);
        }
        else if(ch == 'e' && kFlag.previous_0 == '/' && kFlag.previous_1 == 'c')
        {
            kFlag.found = TRUE;
            SendBackSpace(2);
            DisplaySingleCharacter(99);
        }
        else if(ch == 'F' && kFlag.previous_0 == '=')
        {
            SendBackSpace(4);
            DisplaySingleCharacter(212);
        }
        else if(ch == 'F' && kFlag.previous_0 == '5')
        {
            SendBackSpace(2);
            DisplaySingleCharacter(215);
        }
        else if(ch == 'F' && kFlag.previous_0 == '3')
        {
            SendBackSpace(2);
            DisplaySingleCharacter(220);
        }
        else if(ch == '/')
        {
            for(int i=0; i<8; i++)
            {
                if(kFlag.previous_0 == double_key_slash[i].key)
                {
                    kFlag.found = TRUE;
                    DisplayCharacters(i,SLASH,0);
                }
            }

        }
        /*    else
        if(ch == 'F' && kFlag.c_bit == TRUE)
         {
           for(int i=0;i<22;i++)
           {
        		if(kFlag.previous_0 == double_key_F[i].key)
        		{
        			kFlag.found = TRUE;
        			DisplayCharacters(i,F_OTTU,0);
        		}
           }

         }
         else
         if(ch == 'e' || ch == ';')
         {
           if(kFlag.s_bit == TRUE)
           {
        	   DisplaySingleCharacter(70);
        	   kFlag.found = TRUE;
        	   kFlag.s_bit = FALSE;
           }
           else
           for(int i=0;i<28;i++)
           {
        		if(kFlag.previous_0 == double_key_ee[i].key)
        		{
        			kFlag.found = TRUE;
        			DisplayCharacters(i,EE,0);
        			if(ch == ';')
        	        DisplaySingleCharacter(195); //only when gudisu is to bo displayed
        		}
           }

         }
        }// kFlag.found == FALSE*/
        else if(ch == 'e' || ch == ';' )
        {
            if(kFlag.s_bit == TRUE)
            {
                DisplaySingleCharacter(70);
                kFlag.found = TRUE;
                kFlag.s_bit = FALSE;
            }
            else
                for(int i=0; i<28; i++)
                {
                    if(kFlag.previous_0 == double_key_ee[i].key)
                    {
                        kFlag.found = TRUE;
                        DisplayCharacters(i,EE,0);
                    }
                }
        }
    }

    if(kFlag.found == FALSE)
    {
        for(int i=0; i<80; i++)
        {
            if(ch == single_key[i].key)
            {
                kFlag.last_consonant = FALSE;
                kFlag.found = TRUE;

                if( (ch == 'f' ||
                        ch == 'u' ||
                        ch == 'U' ||
                        ch == 'I' ||
                        ch == 'i' ||
                        ch == 'o' ||
                        ch == 'O' ||
                        ch  == ']'
                    ) &&
                        kFlag.c_bit == TRUE)
                {
                    kFlag.c_bit = FALSE;
                    vDisplayGunitakshara(ch);

                }
                else
                    DisplayCharacters(i,SINGLE,0);


                for (int j = 0; j<10; j++)
                {
                    if(ch == cConsonnants[j])
                    {
                        kFlag.u_bit = TRUE;
                    }
                }

                if(kFlag.u_bit == FALSE )
                {
                    kFlag.c_bit = TRUE;
                }
                else
                {
                    kFlag.u_bit = FALSE;
                }
            }
        }
    }

    if((isalnum(ch))||(ispunct(ch))&&(!(GetKeyState(VK_SPACE))||!(GetKeyState(VK_SHIFT))))
        CopyPrevious(ch);

    kFlag.s_bit = FALSE;
    return bHandledKeystroke;

}
Beispiel #6
0
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////  This Function Finds The Character in The Tables in Found Calls     /////////////////////////////
/////////////////////////////  The Display Functions With Position (i),and The Starting Position  /////////////////////////////
/////////////////////////////  Of The Of The Message To Be Posted The Argument 					  /////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
int FindCharacters(char ch) 
{       

	
   	BOOL bHandledKeystroke = FALSE;
	kFlag.found	= 0;

if(ch == ']' && kFlag.s_bit == TRUE)
{
	kFlag.s_bit = FALSE;
	return bHandledKeystroke;
}
if(kFlag.s_bit == TRUE)
{
   kFlag.s_bit = FALSE;
	
/*
	for(int i=0;i<43;i++)
	{
		if(ch == numerals[i].key)
		{
		//	SendBackSpace(1);//Eleminate the space 
			DisplayCharacters(i,NUMERALS,0);
			kFlag.found = TRUE;
			return bHandledKeystroke;
		}
	}
	*/
}

////////
/////// for poo hoo vooo---------------------------------------
////////

	if(ch == 'f' && kFlag.previous_0 == 'u' && kFlag.previous_1 == '\'' && kFlag.previous_2 == '=' && kFlag.previous_3 == 'p' )
	{
		kFlag.found = TRUE;
		SendBackSpace(2);
		DisplayDoubleCharacter(73,196);
		return bHandledKeystroke;
	}
	if(ch == 'u' && kFlag.previous_0 == 'u' && kFlag.previous_1 == 'm')
	{
		kFlag.found = TRUE;
		SendBackSpace(2);
		DisplaySingleCharacter(212);
		return bHandledKeystroke;
	}
	if(ch == 'u' && kFlag.previous_0 == 'y' && kFlag.previous_1 == 'H' )
	{
		kFlag.found = TRUE;
		SendBackSpace(1);
		DisplaySingleCharacter(199);
		return bHandledKeystroke;
	}
	if(ch == '}' && kFlag.previous_0 == 'K' )
	{
		kFlag.found = TRUE;
		SendBackSpace(1);
		DisplaySingleCharacter(205);
		return bHandledKeystroke;
	}
    if(ch == 'f' && kFlag.previous_0 == 'u' && kFlag.previous_1 == '\'' && kFlag.previous_2 == 'p'  )
	{
		kFlag.found = TRUE;
		SendBackSpace(1);
		DisplaySingleCharacter(199);
		return bHandledKeystroke;
	}
	if(ch == 'f' && kFlag.previous_0 == 'u' && kFlag.previous_1 == '\'' && kFlag.previous_2 == 'h'  )
	{
		kFlag.found = TRUE;
		SendBackSpace(1);
		DisplaySingleCharacter(199);
		return bHandledKeystroke;
	}
	if(ch == 'f' && kFlag.previous_0 == '\'' && kFlag.previous_1 == '7')
	{
		//SendBackSpace(1);
		kFlag.found = TRUE;
		DisplaySingleCharacter(199);
		return bHandledKeystroke;
	}
	if(ch == 'f' && kFlag.previous_0 == 'u' && kFlag.previous_1 == '\'' && kFlag.previous_2 == 'E')
	{
		kFlag.found = TRUE;
		SendBackSpace(2);
		DisplayDoubleCharacter(198,213);
		return bHandledKeystroke;
	}
	if(ch == 'f' && kFlag.previous_0 == 'u' && kFlag.previous_1 == 'E')
	{
		kFlag.found = TRUE;
		SendBackSpace(2);
		DisplayDoubleCharacter(198,213);
		return bHandledKeystroke;
	}
	
	if(ch == ']' && kFlag.previous_0 == '=' && kFlag.previous_1 == 'P')
	{
		kFlag.found = TRUE;
		SendBackSpace(1);
		DisplaySingleCharacter(207);
		return bHandledKeystroke;
	}

if(ch == '"' && kFlag.previous_0 == 'p')
{
	kFlag.found = TRUE;
	SendBackSpace(2);
	DisplayDoubleCharacter(181,192);
		return bHandledKeystroke;
}

if(ch == 'm' && kFlag.previous_0 == 'm')
{
	kFlag.found = TRUE;
	SendBackSpace(1);
	DisplaySingleCharacter(237);
	return bHandledKeystroke;
}
if(ch == '"' && kFlag.previous_0 == '[')
{
	kFlag.found = TRUE;
	SendBackSpace(1);
	DisplaySingleCharacter(182);
		return bHandledKeystroke;
}
if(ch == '=' && kFlag.previous_0 == 'q')
{
	kFlag.found = TRUE;
	SendBackSpace(2);
	DisplaySingleCharacter(234);
	return bHandledKeystroke;
}

if(ch == '=')
{
//	MessageBox(NULL,"fv","vfv",MB_OK);
	for(int i=0;i<=15;i++)
	{   
		if(kFlag.found == 0)
		if(kFlag.previous_0 == doublekey_equals[i].key)
			{
				 DisplayCharacters(i,EQUALS,0);
				 kFlag.found = TRUE;
				 CopyPrevious(ch);
				 return bHandledKeystroke;
			}//----End Of  if ---//
	}//----End of for----//
	if(kFlag.found == FALSE)
	{
	DisplaySingleCharacter(44);
	CopyPrevious(ch);
	return bHandledKeystroke;
	}
}

if(ch == '+')
{
//	MessageBox(NULL,"fv","vfv",MB_OK);
	if(kFlag.previous_0 == '=' && kFlag.previous_1 == '<')
	{
		kFlag.found = TRUE;
		SendBackSpace(1);
		DisplaySingleCharacter(220);
			return bHandledKeystroke;
	}
	for(int i=0;i<=4;i++)
	{   
		if(kFlag.found == 0)
		if(kFlag.previous_0 == doublekey_plus[i].key)
			{
				 DisplayCharacters(i,PLUS,0);
				 kFlag.found = TRUE;
				 	return bHandledKeystroke;
			}//----End Of  if ---//
	}//----End of for----//
	if(!kFlag.found)
	{
		if(kFlag.previous_0 == 'F' && kFlag.previous_1 == 'r' && kFlag.found == 0)
		{
			DisplaySingleCharacter(70);
			kFlag.found = TRUE;
				return bHandledKeystroke;
		}
		if(kFlag.previous_0 == '=' && kFlag.previous_1 == ',' && kFlag.found == 0)
		{
			SendBackSpace(3);
			DisplayDoubleCharacter(120,192);
			kFlag.found = TRUE;
				return bHandledKeystroke;
		}
		if(kFlag.previous_0 == '=' && kFlag.previous_1 == '.' && kFlag.found == 0)
		{
			SendBackSpace(2);
			DisplaySingleCharacter(121);
			kFlag.found = TRUE;
			    return bHandledKeystroke;
		}
	}

}

if(ch == ']')
{
//	MessageBox(NULL,"fv","vfv",MB_OK);
	for(int i=0;i<5;i++)
	{   
		if(kFlag.found == 0)
		if(kFlag.previous_0 == doublekey_sq_bracket[i].key)
			{
				 DisplayCharacters(i,SQ_BRACKET,0);
				 kFlag.found = TRUE;
			}//----End Of  if ---//
	}//----End of for----//
	if(!kFlag.found)
	{
	if(kFlag.previous_0 == '=' && kFlag.previous_1 == 'p' && kFlag.found == 0)
		{
			SendBackSpace(3);
			DisplayDoubleCharacter(87,192);
			kFlag.found = TRUE;
				return bHandledKeystroke;
		}
	if(kFlag.previous_0 == '=' && kFlag.previous_1 == '[' && kFlag.found == 0)
		{
			SendBackSpace(2);
			DisplaySingleCharacter(88);
			kFlag.found = TRUE;
				return bHandledKeystroke;
		}
	}
}

if(ch == 'u' )
{
	if(!kFlag.found)
	{
	if(kFlag.previous_0 == 'Y' && kFlag.previous_1 == 'H' && kFlag.found == 0)
		{
			SendBackSpace(2);
			DisplayTripleCharacter(83,192,196);
			kFlag.found = TRUE;
			return bHandledKeystroke;
		}
	else
	if(kFlag.previous_0 == 'Y' && kFlag.previous_1 == 'm' && kFlag.found == 0)
		{
			SendBackSpace(2);
			DisplayFourCharacter(65,105,192,196);
			kFlag.found = TRUE;
			return bHandledKeystroke;
		}
	else//-------------------For Four keyed Values----------------------------------//
	if(kFlag.previous_0 == '=' && kFlag.previous_1 == 'u' && kFlag.previous_2 == 'r'&& kFlag.found == 0)
		{
			SendBackSpace(2);
			DisplayDoubleCharacter(104,196);
			kFlag.found = TRUE;
			return bHandledKeystroke;
		}
	else
	if(kFlag.previous_0 == '=' && kFlag.previous_1 == 'u'&& kFlag.previous_2 == '4' && kFlag.found == 0)
		{
			SendBackSpace(2);
			DisplayTripleCharacter(106,104,196);
			kFlag.found = TRUE;
			return bHandledKeystroke;
		}
	else
	if(kFlag.previous_0 == ']' && kFlag.previous_1 == 'u'&& kFlag.previous_2 == 'm' && kFlag.found == 0)
		{
			SendBackSpace(2);
			DisplayDoubleCharacter(172,196);
			kFlag.found = TRUE;
			return bHandledKeystroke;
		}
	else
	if(kFlag.previous_0 == 'p' || kFlag.previous_0 == 'h')
	{
		kFlag.found = 1;
		DisplaySingleCharacter(197);
	}
	else
	if(kFlag.previous_0 == 'E' )
	{
		kFlag.found = TRUE;
		SendBackSpace(1);
		DisplayDoubleCharacter(196,213);
	}
	}
}
else
if(ch == 'i' && kFlag.previous_0 == '}' )
{
	SendBackSpace(1);
	DisplaySingleCharacter(75);
	kFlag.found = TRUE;
		return bHandledKeystroke;
}
else
if(ch == 'o' && kFlag.previous_0 == '}' )
{
	SendBackSpace(1);
	DisplaySingleCharacter(78);
	kFlag.found = TRUE;
		return bHandledKeystroke;
}
else
if(ch == 'O' && kFlag.previous_0 == 'o' )
{
	SendBackSpace(1);
	DisplaySingleCharacter(79);
	kFlag.found = TRUE;
	return bHandledKeystroke;
}
else
if(ch == 'I' &&kFlag.previous_0 == '\'')
				 {	 
					//SetGlyphs(ch,
					DisplaySingleCharacter(202);
					kFlag.found = TRUE;
				 }
				 else
				 if(ch == '\'' && kFlag.c_bit == TRUE)
				 {
					 kFlag.c_bit = FALSE;
					switch(kFlag.previous_0)
					{
							case 'b' :
							 if(kFlag.o_bit == 0)
							 {
								SetGlyphs(ch,167);					//This function sets the glyph 
								kFlag.n_back = -1;                    //---patterns for thes specified characters
								DisplaySingleCharacter(201);
								kFlag.found = TRUE;
							 }
							 else
							 {
							 kFlag.o_bit = 0;
							 SendBackSpace(1);
							 DisplaySingleCharacter(201);
							 kFlag.found = TRUE;
							 }
								
							break;
						    case 'H' :
								SetGlyphs(ch,82);					//This function sets the glyph 
								kFlag.n_back = -1;                    //---patterns for thes specified characters
								DisplaySingleCharacter(201);
								kFlag.found = TRUE;
							break;
							case 'j' :
								SetGlyphs(ch,100);
								kFlag.n_back = 0;
								DisplaySingleCharacter(201);
								kFlag.found = TRUE;
							break;
							case 't' :
								SetGlyphs(ch,108);
								DisplaySingleCharacter(201);
								kFlag.found = TRUE;
							break;
							case 'z' :
								SetGlyphs(ch,116);
								DisplaySingleCharacter(201);
								kFlag.found = TRUE;
							break;
							case 'l' :
								SetGlyphs(ch,174);
								DisplaySingleCharacter(201);
								kFlag.found = TRUE;
							break;
							case 'E' :
								kFlag.found = TRUE;
								SendBackSpace(2);
								DisplayTripleCharacter(101,201,213);
							break;
							default:
								SendBackSpace(1);
								DisplaySingleCharacter(201);
								kFlag.found = TRUE;
					}//----End of switch (previous_0)----//

				 }
				 else
				 if (ch == 'f' && kFlag.c_bit == TRUE)
				 {
					kFlag.c_bit = FALSE;
					switch(kFlag.previous_0)
					{
							case 'b' :
							 if(kFlag.o_bit == 0)
							 {
								 //SendBackSpace(1);
								SetGlyphs(ch,167);					//This function sets the glyph 
								kFlag.n_back = -1;                    //---patterns for thes specified characters
								DisplaySingleCharacter(193);
								kFlag.found = TRUE;
							 }
							 else
							 {
							 kFlag.o_bit = 0;
							 SendBackSpace(1);
							 DisplaySingleCharacter(193);
							 kFlag.found = TRUE;
							 }
								
							break;
						    case 'H' :
								SetGlyphs(ch,82);					//This function sets the glyph 
								kFlag.n_back = -1;                    //---patterns for thes specified characters
								DisplaySingleCharacter(193);
								kFlag.found = TRUE;
							break;
							case 'j' :
								SetGlyphs(ch,100);
								kFlag.n_back = 0;
								DisplaySingleCharacter(193);
								kFlag.found = TRUE;
							break;
							case 't' :
								SetGlyphs(ch,108);
								DisplaySingleCharacter(193);
								kFlag.found = TRUE;
							break;
							case 'z' :
								SetGlyphs(ch,116);
								DisplaySingleCharacter(193);
								kFlag.found = TRUE;
							break;
							case 'l' :
								SetGlyphs(ch,174);
								DisplaySingleCharacter(193);
								kFlag.found = TRUE;
							break;
							case 'U' :
								SendBackSpace(1);
								DisplaySingleCharacter(72);
								kFlag.found = TRUE;
								break;
							case '7' :
								SendBackSpace(1);
								DisplaySingleCharacter(199);
								kFlag.found = TRUE;
								break;
							case 'u' :
										kFlag.found = TRUE;
										DisplayDoubleCharacter(8,198);
								break;
							case 'E' :
										kFlag.found = TRUE;
										SendBackSpace(2);
										DisplayTripleCharacter(101,193,213);
								break;
							default:
								SendBackSpace(1);
								DisplaySingleCharacter(193);
								kFlag.found = TRUE;
					}//----End of switch (previous_0)----//


				 }
     		    else
				 if(ch == ']' && kFlag.c_bit == TRUE)
				 {
					kFlag.c_bit = FALSE ;
					switch(kFlag.previous_0)
					{
						
						case 'b' :
							 if(kFlag.o_bit == 0)
							 {
								 SendBackSpace(1);
								SetGlyphs(ch,167);					//This function sets the glyph 
								kFlag.n_back = -1;                    //---patterns for thes specified characters
								DisplaySingleCharacter(169);
								kFlag.found = TRUE;
							 }
							 else
							 {
								kFlag.o_bit = 0;
								kFlag.s_bit = 1;  //---------To be used for further ie; for bhi-------//
								SendBackSpace(1);			//This function sets the glyph 
										            //---patterns for thes specified characters
								DisplaySingleCharacter(169);
								kFlag.found = TRUE;
							 }
							break;
						    case 'H' :
								SendBackSpace(1);				//This function sets the glyph 
								                    //---patterns for thes specified characters
								DisplaySingleCharacter(84);
								kFlag.found = TRUE;
							break;
							case 'j' :
								SendBackSpace(1);
								kFlag.n_back = 0;
								DisplaySingleCharacter(102);
								kFlag.found = TRUE;
							break;
							case 't' :
								SendBackSpace(1);
								DisplaySingleCharacter(110);
								kFlag.found = TRUE;
							break;
							
							case 'l' :
								SendBackSpace(1);
								DisplaySingleCharacter(176);
								kFlag.found = TRUE;
							break;
						/*	case '=' :
								SendBackSpace(2);
								DisplaySingleCharacter(88);
								kFlag.found = TRUE;
							break;*/
							case '\\' :
								SendBackSpace(2);
								DisplaySingleCharacter(182);
								kFlag.found = TRUE;
							break;
							case 'y' :
								SendBackSpace(3);
								DisplaySingleCharacter(172);
								kFlag.found = TRUE;
							break;
							case 'E' :
								kFlag.found = TRUE;
								SendBackSpace(2);
								DisplayDoubleCharacter(102,213);
								break;
							default:
							break;
					}//----End of switch (previous_0)----//
		
				 }
				 else
					 if(ch == '}' && kFlag.c_bit == TRUE)
					 {
						 kFlag.c_bit = FALSE;
						 switch(kFlag.previous_0)
						{
							case 'i':
							SendBackSpace(1);
							DisplaySingleCharacter(75);
							kFlag.found = TRUE;
							break;		
							case 'o':
							SendBackSpace(1);
							DisplaySingleCharacter(78);
							kFlag.found = TRUE;
							break;		
					
							case 'b' :
							 if(kFlag.o_bit == 0)
							 {
								SetGlyphs(ch,167);					//This function sets the glyph 
								kFlag.n_back = -1;                    //---patterns for thes specified characters
								DisplaySingleCharacter(239);
								kFlag.found = TRUE;
							 }
							 else
							 {
							 kFlag.o_bit = 0;
							 SendBackSpace(1);
							 DisplaySingleCharacter(239);
							 kFlag.found = TRUE;
							 }
							break;
						    case 'H' :
								SetGlyphs(ch,82);					//This function sets the glyph 
								kFlag.n_back = -1;                    //---patterns for thes specified characters
								DisplaySingleCharacter(239);
								kFlag.found = TRUE;
							break;
							case 'j' :
								SetGlyphs(ch,100);
								kFlag.n_back = 0;
								DisplaySingleCharacter(239);
								kFlag.found = TRUE;
							break;
							case 't' :
								SetGlyphs(ch,108);
								DisplaySingleCharacter(239);
								kFlag.found = TRUE;
							break;
							case 'z' :
								SetGlyphs(ch,116);
								DisplaySingleCharacter(239);
								kFlag.found = TRUE;
							break;
							case 'l' :
								SetGlyphs(ch,174);
								DisplaySingleCharacter(239);
								kFlag.found = TRUE;
							break;
							case 'E' :
								kFlag.found = TRUE;
								SendBackSpace(2);
								DisplayTripleCharacter(101,239,213);
							break;
							default:
								SendBackSpace(1);
								DisplaySingleCharacter(239);
								kFlag.found = TRUE;
						 }//----End of switch (previous_0)----//
					 }
					 if(ch == 'O')
					 {
						 switch(kFlag.previous_0)
						 {
							case 'b' :
							 if(kFlag.o_bit == 0)
							 {
								SetGlyphs(ch,167);					//This function sets the glyph 
								kFlag.n_back = -1;                    //---patterns for thes specified characters
								DisplaySingleCharacter(203);
								kFlag.found = TRUE;
							 }
							 else
							 {
							 kFlag.o_bit = 0;
							 SendBackSpace(1);
							 DisplaySingleCharacter(203);
							 kFlag.found = TRUE;
							 }
							 break;
						    case 'H' :
								SetGlyphs(ch,82);					//This function sets the glyph 
								kFlag.n_back = -1;                    //---patterns for thes specified characters
								DisplaySingleCharacter(203);
								kFlag.found = TRUE;
							break;
							case 'j' :
								SetGlyphs(ch,100);
								kFlag.n_back = 0;
								DisplaySingleCharacter(203);
								kFlag.found = TRUE;
							break;
							case 't' :
								SetGlyphs(ch,108);
								DisplaySingleCharacter(203);
								kFlag.found = TRUE;
							break;
							case 'z' :
								SetGlyphs(ch,116);
								DisplaySingleCharacter(203);
								kFlag.found = TRUE;
							break;
							case 'l' :
								SetGlyphs(ch,174);
								DisplaySingleCharacter(203);
								kFlag.found = TRUE;
							break;
							case 'E' :
								kFlag.found = TRUE;
								SendBackSpace(2);
								DisplayTripleCharacter(101,203,213);
							break;

						 
							 break;
						 default :
							 SendBackSpace(1);
							 DisplaySingleCharacter(203);
						 }
							 
					 }
	if(ch == ';'&& kFlag.previous_0 == 'F' && kFlag.previous_1 == 'r')
					{
						kFlag.found = TRUE;
						SendBackSpace(3);
						DisplaySingleCharacter(70);
					}     
	if(ch == 'f' && kFlag.previous_0 == 'u' && kFlag.previous_1 == 'v')
					{
						kFlag.found = TRUE;
						SendBackSpace(1);
						DisplayDoubleCharacter(105,193);
					}
	if(ch == 'f' && kFlag.previous_0 == 'u' && (kFlag.previous_1 == 'p' || kFlag.previous_1 == 'h'))
					{
						kFlag.found = TRUE;
						SendBackSpace(1);
						DisplaySingleCharacter(199);
					}
	if(ch == 'O' &&  kFlag.previous_0 == 'u' && kFlag.previous_1 == 'y' && kFlag.previous_2 == 'm')
	{
		kFlag.found = TRUE;
		SendBackSpace(1);
		DisplayDoubleCharacter(105,203);
	}
	if(ch == 'O' &&  kFlag.previous_0 == 'u' && kFlag.previous_1 == '=' && kFlag.previous_2 == 'u'&& kFlag.previous_3 == 'r')
	{
		kFlag.found = TRUE;
		SendBackSpace(1);
		DisplayDoubleCharacter(105,203);
	}
	if(ch == 'O' &&  kFlag.previous_0 == 'u' && kFlag.previous_1 == 'v')
	{
		kFlag.found = TRUE;
		SendBackSpace(1);
		DisplayDoubleCharacter(105,203);
	}


if(kFlag.found == FALSE)
	{
	for(int i=0;i<=90;i++)
		{   
			if(kFlag.found == 0)
			if(ch == singlekey_singleglyph[i].key)
				{
					kFlag.c_bit = TRUE;
 					DisplayCharacters(i,SINGLE,0);
					kFlag.found = TRUE;
				}//----End Of  if ---//
		}//----End of for----//
	}
	if(!kFlag.found)
	{
		vDisplay_Gunitaksharas(ch);
	}
	


	if(isspace(ch))
	{
	kFlag.s_bit = 1;
    kFlag.c_bit = 0 ;
    kFlag.q_bit = 0;
	}

	CopyPrevious(ch);

	return bHandledKeystroke;

}