private void processMouseActivity(int button, int xPosScaled, int yPosScaled, int modifiers) {

        if (button == MouseEvent.BUTTON1 || button == MouseEvent.BUTTON3) {
            if (xPosScaled < 0 || xPosScaled >= currentScaledWidth) {
                // ignore it
                return;
            }

            if (yPosScaled < 0 || yPosScaled >= currentScaledHeight) {
                // ignore it
                return;
            }

            int xPos = xPosScaled / scale;
            int yPos = yPosScaled / scale;
            int xBoxSize = PPUConstants.CHR_WIDTH;
            int yBoxSize = PPUConstants.CHR_HEIGHT;

            int overallX = xPos / xBoxSize;
            int overallY = yPos / yBoxSize;
            int pg = determinePage(overallX, overallY);

            int relX = overallX % PPUConstants.NAME_TABLE_WIDTH;
            int relY = overallY % PPUConstants.NAME_TABLE_HEIGHT;

            int index = (relY * PPUConstants.NAME_TABLE_WIDTH) + relX;

            // OAM (or attribute tables) are weird
            // the name table is 32x30 nameTableTiles
            // these get grouped into 16x15 2x2 nameTableTiles where 2 bits per tile-set specify most signifigant color bits
            // those 2x2 tilesets get grouped again (into a 4x4 tileset) giving a total of 8 bits
            // the bits get packed : bottomRight,BottomLeft,TopRght,TopLeft
            int oamGroupX = (relX / 2) % 2; // gets us in terms of a 16 x 16 table
            int oamGroupY = (relY / 2) % 2;
            int oamIndexX = relX / 4; // gets us in terms of an 8x8 table
            int oamIndexY = relY / 4;

            int oamSubIndex = oamGroupY * 2 + oamGroupX;
            int oamTableIndex = oamIndexY * PPUConstants.OAM_INDEX_GRID_SIZE + oamIndexX;
            if (button == MouseEvent.BUTTON1) {
                processLeftClick(pg, index, oamSubIndex, oamTableIndex, modifiers);
            }
            if (button == MouseEvent.BUTTON3) {
                processRightClick(pg, index, oamSubIndex, oamTableIndex, modifiers);
            }
        }
    }