Пример #1
0
bool MemoryViewerControl::OnKeyDown( UINT nChar ) 
{
	int maxNibble = 0;
	if( m_nDataSize == 0 )
		maxNibble = 1;
	else if( m_nDataSize == 1 )
		maxNibble = 3;
	else
		maxNibble = 7;

	bool bShiftHeld = ( GetKeyState(VK_SHIFT) & 0x80000000 ) == 0x80000000;

	switch( nChar )
	{
	case VK_RIGHT:
		if( bShiftHeld )
			moveAddress( ( maxNibble + 1 ) >> 1, 0 );
		else
			moveAddress( 0, 1 );
		return true;

	case VK_LEFT:
		if( bShiftHeld )
			moveAddress( -( ( maxNibble + 1 ) >> 1 ), 0 );
		else
Пример #2
0
void MemoryViewer::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags)
{
  bool isShift = (GetKeyState(VK_SHIFT) & 0x80000000) == 0x80000000;

  switch(nChar) {
  case VK_RIGHT:
    if(editAscii)
      moveAddress(1,0);
    else if(isShift)
      moveAddress((maxNibble+1)>>1,0);
    else
      moveAddress(0, 1);
    break;
  case VK_LEFT:
    if(editAscii)
      moveAddress(-1, 0);
    else if(isShift)
      moveAddress(-((maxNibble+1)>>1),0);
    else